Hello,
I am using an OpenMV H7 and attempting to test my script using a video input. In this script, I try to draw rectangles for debugging purposes, but nothing is displayed on the output.
The video stream is correctly read and displayed in the OpenMV IDE, so the input source appears to be working as expected.
Below is the code I am using. I am not sure whether I am missing a step or if there is an issue in my implementation.
import image
import time
stream = image.ImageIO("test2.bin", "r")
clock = time.clock() # Create a clock object to track the FPS.
while True:
clock.tick()
img = stream.read(copy_to_fb=True, loop=True, pause=True)
img.draw_string(10, 10, "HELLO", color=(255, 0, 0))
img.draw_rectangle(0, 0, 100, 100, color=(255, 0, 0))
print(clock.fps())
Thank you for your help.
Can you post the bin file?
Hi @kwagyeman
I received an error when trying to upload the file directly from the forum: “Sorry, new users cannot upload attachments.”
You can download it here: https://drive.google.com/file/d/1IxagU8IDGEtll2ypmSaL9USgoK4FtQ3O/view?usp=sharing
Thank you for your help!
Okay, here’s a firmware with this fixed. Note that it’s using the new v5.0.0 API:
import image
import time
stream = image.ImageIO("test2.bin", "r")
clock = time.clock() # Create a clock object to track the FPS.
while True:
clock.tick()
img = stream.read(loop=True, pause=True)
img.draw_string((10, 10), "HELLO", color=(255, 0, 0))
img.draw_rectangle((0, 0, 100, 100), color=(255, 0, 0))
print(clock.fps())
Grab scripts from here until we are done with the release: openmv/scripts/examples at master · openmv/openmv · GitHub
firmware.zip (1.1 MB)
Fixed here: modules: Fix copy_to_fb image stream update. by kwagyeman · Pull Request #3186 · openmv/openmv · GitHub