twistedfall / opencv-rust

Rust bindings for OpenCV 3 & 4
MIT License
1.96k stars 157 forks source link

Port hough circle example from OpenCV 4.9.0 #547

Closed jddj137 closed 7 months ago

jddj137 commented 7 months ago

Port of https://github.com/opencv/opencv/blob/4.7.0/samples/cpp/tutorial_code/ImgTrans/HoughCircle_Demo.cpp, based on the examples/hough_lines.rs port of the HoughLines_Demo.cpp. Added examples/data directory with sample image from https://github.com/opencv/opencv/tree/4.9.0/samples/data to visually verify the port was working as expected and allow users to run the example.

twistedfall commented 7 months ago

Thanks a lot for the contribution! Can you please fix a couple of things before we merge this?

  1. The link to the cpp example is 404, the actual link is https://github.com/opencv/opencv/blob/4.7.0/samples/cpp/tutorial_code/ImgTrans/HoughCircle_Demo.cpp (Circle is singular). Maybe also rename the name of the example to also be hough_circle.
  2. For canny_threshold and accumulator_threshold I think it's better to use AtomicI32, it should be way lighter than a Mutex.
twistedfall commented 7 months ago

Thank you!