Hi,
I am using H7 R2, and trying to upload a photo and work on it for debugging purposes. I understand that I should use BMP format but am unable to upload the image properly.
Adding the code and the image i’m using. I have also an sd card inside the module.
I can only upload jpg here but I converted it to bmp using this site:
# Copy image to framebuffer.
#
# This example shows how to load and copy an image to framebuffer for testing.
import sensor, image, time
# Still need to init sensor
sensor.reset()
# Set sensor settings
sensor.set_contrast(1)
sensor.set_gainceiling(16)
# Set sensor pixel format
sensor.set_framesize(sensor.VGA)
sensor.set_pixformat(sensor.GRAYSCALE)
# Load image
img = image.Image("/pool.bmp", copy_to_fb=True)
img.draw_line((100,100,400,100), color = (255, 0, 0))
# Add a small delay to allow the IDE to read the loaded image.
time.sleep_ms(500)
you have already declared the frame to be vga resolution.
this means that maximum size can handle will be 640x480.
You can change sensor.set_framesize(sensor.VGA) to much your creteria or import vga res images.
What is the maximum size that can be handled for H7 R2 without it begin cropped?
This is the link to the file i’m using:
I get this error using the file:
OSError: Unexpected value read!
# Copy image to framebuffer.
#
# This example shows how to load and copy an image to framebuffer for testing.
import sensor, image, time
# Still need to init sensor
sensor.reset()
# Set sensor settings
sensor.set_contrast(1)
sensor.set_gainceiling(16)
# Set sensor pixel format
sensor.set_framesize(sensor.VGA)
sensor.set_pixformat(sensor.GRAYSCALE)
# Load image
img = image.Image("/picture.bmp", copy_to_fb=True)
img.draw_line((100,100,400,100), color = (255, 0, 0))
# Add a small delay to allow the IDE to read the loaded image.
time.sleep_ms(500)
Also I am saving the file(~300kB) in a memory card attached to the device(if it matters)
Just try a VGA image size and the code will work out the maximum result.
As for the error, what line? Please, forums are a two way street. Posting, it doesn’t work and then not being specific about what is wrong won’t help me help you.