Hello! I just got the OpenMV and am starting to use it.
I’m trying to save snapshots from the OpenMV camera as 150x150 pixel size .bmp images. When I check the sizing of the .bmp file in the hex code of its header, it says that the width = 150 pixels , but the height is 106 pixels. I tried saving a snapshot as a .jpg file and then converting it to a .bmp file with an online converter, and the dimensions are 150 x 150 as expected. Is there something wrong with how I’m saving the .bmp file? Using the .jpg → .bmp conversion workaround isn’t ideal because I’d like to be able to send these .bmp files from the OpenMV to a different H7 board down the line.
Here’s the code I’m using:
sensor.reset() # Initialize the camera sensor. sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.VGA) # check the sensor resolution width/height print("Sensor width = ", sensor.width(), "; Sensor height = ", sensor.height()) sensor.set_windowing((120,140,150,150)) sensor.skip_frames(time = 2000) # Let new settings take affect. pyb.LED(RED_LED_PIN).on() sensor.skip_frames(time = 3000) # Give the user 3 seconds to get ready. pyb.LED(RED_LED_PIN).off() pyb.LED(BLUE_LED_PIN).on() print("You're on camera!") sensor.snapshot().save("wo8.bmp") # Save Pic.
I’ve attached 2 images of the hex code. One was saved directly from the openMV code, and the other I converted from jpg to bmp.
Thanks so much for any help!