Page 1 of 1

OpenCV Library

Posted: Fri Apr 27, 2018 4:59 pm
by lab
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?

Re: OpenCV Library

Posted: Sat Apr 28, 2018 4:30 am
by iScienceLuvr
Yes, I am also interested in this functionality. I want to use lucas-kanade algorithm in OpenCV on the OpenMV camera.

Re: OpenCV Library

Posted: Sat Apr 28, 2018 12:56 pm
by kwagyeman
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.

Re: OpenCV Library

Posted: Sat Apr 28, 2018 4:19 pm
by iScienceLuvr
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...

Re: OpenCV Library

Posted: Sat Apr 28, 2018 5:13 pm
by kwagyeman
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

Re: OpenCV Library

Posted: Sat May 19, 2018 7:23 pm
by lab
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/

Re: OpenCV Library

Posted: Mon May 21, 2018 11:56 pm
by kwagyeman
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?