Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ ENV PATH="$PATH:/root/julia-1.8.5/bin"
# Uncomment to install shotwell, an image utility. Not required.
#RUN apt-get update && apt-get install shotwell --no-install-recommends -y

RUN julia -e "using Pkg; Pkg.instantiate()"
# RUN julia -e "using Pkg; Pkg.instantiate()"

RUN apt-get update && apt-get install vim -y

RUN julia -e "using Pkg; Pkg.add(\"PythonCall\")"

CMD "/bin/bash"
26 changes: 18 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,26 @@ cd /root/src

You are now ready to execute code!

## Julia Setup

From inside the docker container
## Running the example
```
LD_PRELOAD="/usr/lib/x86_64-linux-gnu/libcurl.so.4" julia sift.jl
```
julia

# Activate the environment
] activate .

# Install the packages
] instantiate
```
## OLD:


# ## Julia Setup
#
# From inside the docker container
# ```
# julia
#
# # Activate the environment
# ] activate .
#
# # Install the packages
# ] instantiate
# ```

Binary file added src/frb.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions src/sift.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# make sure it uses the system-instaled python backend
ENV["JULIA_CONDAPKG_BACKEND"] = "Null"
ENV["JULIA_PYTHONCALL_EXE"] = "/usr/bin/python3"

using PythonCall

# import opencv

cv = pyimport("cv2")

# run the sift commands

img = cv.imread("frb.jpg")
gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY)

sift = cv.SIFT_create()

kp = sift.detect(gray, pybuiltins.None)

img = cv.drawKeypoints(gray, kp, img)

cv.imwrite("sift_keypoints_julia.jpg", img)
12 changes: 12 additions & 0 deletions src/sift.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import numpy as np
import cv2 as cv

img = cv.imread("frb.jpg")
gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY)

sift = cv.SIFT_create()
kp = sift.detect(gray, None)

img = cv.drawKeypoints(gray, kp, img)

cv.imwrite('sift_keypoints.jpg', img)
Binary file added src/sift_keypoints.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.