OpenCV Library

General discussion about topics related to OpenMV.
lab
Posts: 17
Joined: Wed Mar 21, 2018 9:02 pm

OpenCV Library

Postby lab » Fri Apr 27, 2018 4:59 pm

Is it possible to import the cv2 Python extension from OpenCV so that we can access the library in OpenMV? For instance, we would like to implement the cv2.HoughCircles function to do circle detection.

Or is it possible to convert the OpenCV source code from C++ to Python?
iScienceLuvr
Posts: 25
Joined: Thu Apr 26, 2018 6:55 pm

Re: OpenCV Library

Postby iScienceLuvr » Sat Apr 28, 2018 4:30 am

Yes, I am also interested in this functionality. I want to use lucas-kanade algorithm in OpenCV on the OpenMV camera.
User avatar
kwagyeman
Posts: 1913
Joined: Sun May 24, 2015 2:10 pm

Re: OpenCV Library

Postby kwagyeman » Sat Apr 28, 2018 12:56 pm

Hi, we already have circle detection on the OpenMV Cam. There's a method called find_circles(). It implements circle detection using the Hough Transform.

As for optical flow... we have that using phase correlation which is better than the lucas-kanade algorithm. There are examples for these things in the IDE examples folder.
Nyamekye,
iScienceLuvr
Posts: 25
Joined: Thu Apr 26, 2018 6:55 pm

Re: OpenCV Library

Postby iScienceLuvr » Sat Apr 28, 2018 4:19 pm

But there is no way for using OpenCV with OpenMV? I am interested in using some other OpenCV functions (like estimating geometric transforms) as well...
User avatar
kwagyeman
Posts: 1913
Joined: Sun May 24, 2015 2:10 pm

Re: OpenCV Library

Postby kwagyeman » Sat Apr 28, 2018 5:13 pm

Please see the rotation correction method. It can do perspective transformation in the x/y/z direction.

As for a more general approach. I plan to add the ability for it to take a list of 4 points and it will do a homography transform.

...

But, anyway, no, all the vision stuff is running on a microcontroller with has a very limited amount of heap space. When me and Ibrahim started working on this project we were developing with the M4 processor which was very limited. Only on the M7 has it been possible to run desktop libraries like AprilTags/Libdmtx/ZBar etc. Even then, to use these libraries we had to port the code by redoing memory allocations. We've been feature creeping with the platform to make it more useful... but, in general the design goal was to just make a sure easy to get started color tracking system like a Pixy Cam but more flexible and able to do everything itself.

Anyway, it's quite possible to run desktop code on the camera if you use the C programming interface: https://github.com/openmv/openmv/wiki. You can really extend the system to do what you want. Note that the AprilTag code brings in a full matrix library with SVD support: https://github.com/openmv/openmv/blob/m ... ag.c#L1027
Nyamekye,
lab
Posts: 17
Joined: Wed Mar 21, 2018 9:02 pm

Re: OpenCV Library

Postby lab » Sat May 19, 2018 7:23 pm

Do you have plans to implement contrast and brightness correction functions (α, β, G) in openMV?

https://docs.opencv.org/3.4.1/d3/dc1/tu ... sform.html
https://www.pyimagesearch.com/2015/10/0 ... orrection/
User avatar
kwagyeman
Posts: 1913
Joined: Sun May 24, 2015 2:10 pm

Re: OpenCV Library

Postby kwagyeman » Mon May 21, 2018 11:56 pm

Brightness correction is available already by using morph() http://docs.openmv.io/library/omv.image ... mage.morph

Um, but, yes, I can add a method for brightness, contrast, and gamma correction. What would you like? Like, what kind of API for it?
Nyamekye,

Return to “General Topics”

Who is online

Users browsing this forum: No registered users and 3 guests