Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to do edge detection, draw and measure contours? #12

Open
benmarwick opened this issue May 25, 2019 · 0 comments
Open

how to do edge detection, draw and measure contours? #12

benmarwick opened this issue May 25, 2019 · 0 comments

Comments

@benmarwick
Copy link

benmarwick commented May 25, 2019

I'm interested to use this pkg to draw and measure contours on object in a video image. This is a fairly classic non-ML use of computer vision for online/streaming object shape and size analysis. We filter the image a bit, then use an algorithm to find the outline (or contour) of the object of interest and collect some metrics about the object via the outline. OpenCV is ideal for this because the implementation of the Canny algorithm it uses for edge detection is excellent and incredibly fast.

This is how I'm doing it in Python (which I know nothing about, code is in a gist here):

quick-test-opencv-live-measurement

Would it be possible to make some of these opencv functions available as R functions this pkg?

  • cv2.threshold
  • cv2.dilate
  • cv2.erode
  • cv2.morphologyEx
  • cv2.cvtColor
  • cv2.drawContours
  • cv2.contourArea
  • cv2.minAreaRect
  • cv2.moments

I can see the C++ versions of these in src/util.cpp in this repo, but I'm not sure how to wrap them so I can use them with R. Thanks!

@benmarwick benmarwick changed the title how to draw contours? how to do edge detection, draw and measure contours? May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant