Due to limited space inside my robot I decided to mount the OpenMV board inside it up-side-down. I figured it will not matter much, as I can simply just flip the y coordinate of whatever results of image processing I get, and it will amount to the same thing. However, I didn’t think about things like face detection, which will not work with up-side-down faces.
I’m now thinking about what I could do. I could flip the image after taking the snapshot and before processing it – it would take some more time, but could work. I looked at the Image class, but didn’t find a way to flip or rotate the image, though.
Next thought, I could probably configure the camera sensor to flip the image – some cameras do have such a function. But again, nothing like that in the Sensor class, except maybe for the raw access to the registers. So I started to look for the datasheet for the camera sensor, thinking that if such an option exists there, it would be explained. But the datasheet is not linked from https://openmv.io/docs/openmv/hardware/index.html and a quick Google search doesn’t seem to yield anything more than a few promotional pamphlets.
FInally, I could probably use a flipped cascade for the face detection, instead of the default one. However, looking at the XML files of the OpenCV examples, it doesn’t seem like it’s a trivial operation to do.
I guess I will simply figure out how to mount the camera right side up, unless someone has any more ideas or hints?
We should be able to add vertical flip and horizontal mirror output to the sensor class. OmniVision sensors support this. The OV7725 does I know. For the OV2640 you can find the data sheet by googling for it here: http://www.uctronics.com/download/cam_module/OV2640DS.pdf
See Page 22. There’s a vertical flip and horizontal mirror register. So, use the register read and register write stuff for now. Its reg 04, bits 6 and 7.
Hello kwagyeman! How to used the sensor.hmirror and sensor.vflip. Rotation function when by define the ROI field. I Need compared one image the diffenece between the up side down or left side right which by define the ROI fields.Thank you for your kindly support!