1
0
mirror of https://github.com/opencv/opencv_contrib.git synced 2025-10-18 08:44:11 +08:00
Files
opencv_contrib/modules/julia/test/test_feature2d.jl
archit120 522a062cad Merge pull request #2547 from archit120:julia-phase1
Julia Bindings GSoC - phase1

* Julia Phase 1 first commit

* a few fixes to compile julia bindings on mac

* Readme changes

* Allow usage before installation and update README

* Add CxxWrap installation and fix Mac build bug

* CMake fixes and test refactoring

* add tests, fix trailing whitespace, disable array-vec conversion

* Fix trailing whiteline and warning

* Add module documentation and fix tests in CMake

* Change copyright block, CMake variable name

* copy => copy_if_different

* fix status dump and return lines

* Remove Julia_Found outside init.cmake

* change indentation

Co-authored-by: Vadim Pisarevsky <vadim.pisarevsky@gmail.com>
2020-06-17 07:33:37 +00:00

24 lines
685 B
Julia

# test simple blob detector
img_gray = OpenCV.imread(joinpath(test_dir, "shared", "pic1.png"), OpenCV.IMREAD_GRAYSCALE)
detector = OpenCV.SimpleBlobDetector_create()
# Compare centers of keypoints and se how many of them match,
kps = OpenCV.detect(detector, img_gray)
kps_expect = [OpenCV.Point{Float32}(174.9114f0, 227.75146f0),OpenCV.Point{Float32}(106.925545f0, 179.5765f0)]
for kp in kps
closest_match = 100000
for kpe in kps_expect
dx = kpe.x - kp.pt.x
dy = kpe.y - kp.pt.y
if sqrt(dx*dx+dy*dy) < closest_match
closest_match = sqrt(dx*dx+dy*dy)
end
end
@test closest_match < 10
end
println("feature2d test passed")