Need help with image.image

Hello,

i keep getting a error thrown saying that it cant find the file. I have the image on the openmv but unsure why it isnt doing anything.

# Load coin template
template = image.Image("coin.bmp")

while(True):
    # Capture image
    img = sensor.snapshot()

    # Find template match in image
    match = img.find_template(template, 0.70)

    # Check if match is found
    if match:
        print("YES")
    else:
        print("NO")

Hi, can you verify the image is written to disk? I.e. safety remove the camera from the PC and then re-attach.

Hello,

I removed the camera and plugged it back in and can see the image on its files

Okay, then it could be the bmp file format. The error message might not say that it’s just something in the file can’t be understood. Please save as a jpeg.