Hi everyone !
I’m working on a project where the main goal is to get the coordinates (in pixels) of multiple laser spots in outside environment. I’m using the OpenMV H7 module as development kit and I have multiple questions.
The previous step I did was using the OpenCV library on a computer with the camera directly connected. Now, I’m trying to make it an embedded system.
I know that it’s not possible to use OpenCV with MicroPython, so I looked in the OpenMV libraries and I didn’t found what I did in my previous algorithms which were manipulating image like converting the all image in a certain color domain (YUV for me). So, I was thinking to make my own C library and link it to the firmware of the OpenMV H7.
I have only basic knowledge about microcontrolers and Python, and the combination of both isn’t very documented ^^.
So here are my questions :
- The OpenMV H7 uses the OV7725, is it possible to use another CMOS with only re-writing the associate driver or does it require a larger modification on the OpenMV libraries ? (I was planning to have the IMX290, mainly for the high fps output in HD mode)
- I was planning to use brutal calculation on the whole image, but maybe the use of blobs would be better or any other method ? (The illumination parameters aren’t constant as it’s in an outdoors environment) And if so, I don’t really understand them ? (I can check on documentation, but if you have something ready to send )
- The convertion to other color spaces is not implemented, do we have to use the commands “image.add”, “image.sub”… To compute them ?
- As I may create my own C library (in further development or other project), how can we implement it into the microcontroler ? Is saw in the wiki page that you use QtCreator to do the development and many steps are detailed, is it what can permit us to add our own modules ? (I run on Windows but I have a dual boot possibility with Ubuntu)
Finally, I had some issues to control my lasers with PWM mode.
Here is my code :
class Foo(object): def __init__(self, timer): timer.channel(1, Timer.PWM, callback=self.cb, pulse_width_percent=50) timer.channel(2, Timer.PWM, callback=self.cb2, pulse_width_percent=5) def cb(self, timer): LED(1).toggle() def cb2(self, timer): LED(2).toggle() obj = Foo(pyb.Timer(3, freq=1))
The cb functions are used on the LEDs, but it can be on the pins too (just have to adapt the code), the fact is that I want to change the intensity of lights with the pulse_width_percent argument. (Here it’s at 1Hz to see if the pulse_width_percent is effective) But when I run the code, I don’t see :
- LED1 + LED2 on : 5%
- LED1 on : 45%
- both LED off : 50%
But I see, in this order :
- LED1 : 25%
- LED1+LED2 : 25%
- LED2 : 25%
- both LED off : 25%
Is that normal behaviour ? Did I miss something ?
When I control only 1 LED, with f=1kHz, I can’t control its intensity with the pulse_width_percent in the way it is coded. I have to add “timer.callback(self.cb)”, which is redondant with the line “timer.channel(…”. Is it normal ? Does it mean that I can’t control the intensity of 2 lasers on different Pins with different methods with the same timer ? (As I need to add the timer.callback function) So, here is my last question : what is the difference between the timer and the channel ? (Do they have to get the same callback function ?)
I know I have many questions and thanks a lot for what you do, and for your answers !