realtime camera frame without IDE

Hi guys :slight_smile: I have a question! I want to get a ‘frame buffer’ like ‘OpenMV IDE’ in the terminal for other project.

I use Ubuntu OS. I Think I can get ‘frame buffer’ when i use opensource- openmv.py or openmv-fb.py.

so I typed ‘sudo python3 openmv.py helloworld.py’ on the terminal.

Is it right ? I have many errors…

please help me, how can I get realtime camera frame without IDE ?

Hi, the newest version of OpenMV IDE has this feature built-in to create terminals at will.

Just do:

./openmv-ide -open_serial_port_termnial /dev/ttyACM0:115200

This will get you an Open Terminal window.

Hi Thank you for the reply!

I Just did that

./openmv-ide -open_serial_port_termnial /dev/ttyACM0:115200

https://drive.google.com/file/d/1t_GO3ctRahNw8u1w0G5pfFGI0QVUsbAA/view?usp=sharing

But I want to get only realtime camera frame without ‘OpenmvIDE’

for example :
ex1
https://drive.google.com/file/d/10FU2khU9rmnhAr8o7tBbeI1G7JNbgYlv/view?usp=sharing
How can I get realtime camera frame like ‘ex1’ ?

Hi, you just need to add:

print(img.compressed_for_ide())

To the end of the while loop after you script and you’ll be able to see what the camera sees. To hide the text just resize the frame buffer until it’s the whole window.

Please put some effort into using this feature in the IDE. I just added it for this purpose. If you want. Check out our you tube video channel where I talk about how to use this.

Thank you !

I can get camera sees after hiding the text and resizing the frame buffer.

but This does not, as I though…

I get frame ex1) , WITHOUT IDE.

Can I get camera sees , using opensource openmv-fb.py ??

https://github.com/openmv/openmv/blob/master/usr/openmv-fb.py

An error occurred, When I executed openmv-fb.py script

JPEG decode error ()
Traceback (most recent call last):
  File "openmv-fb.py", line 73, in <module>
    fb = openmv.fb_dump()
  File "/home/jason/openmv-master/usr/openmv.py", line 71, in fb_dump
    size = fb_size()
  File "/home/jason/openmv-master/usr/openmv.py", line 68, in fb_size
    return struct.unpack("III", __serial.read(12))      #serial.read(12) :read up to 12 bytes
struct.error: unpack requires a bytes object of length 12

Ibrahim just fixed this script. Um, let me ping him. It should be able to give you a frame however.

Hi, please use the latest script from the repo:

https://raw.githubusercontent.com/openmv/openmv/master/usr/openmv-fb.py

And run it using Python2

@iabdalkader
Works! Thank you very much!! guys !

but I have a problem. ㅜㅜ

pygame window Frame is low … actually very slow…

Can I raise the frame ?

I get about 80FPS not sure why it’s slow on your machine. You shouldn’t run this on VM if you are.