realtime camera frame without IDE

General discussion about topics related to OpenMV.
jason.sjh7@gmail.com
Posts: 4
Joined: Tue Dec 19, 2017 4:50 am

realtime camera frame without IDE

Postby jason.sjh7@gmail.com » Tue Dec 19, 2017 10:52 pm

Hi guys :) 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 ?
User avatar
kwagyeman
Posts: 2286
Joined: Sun May 24, 2015 2:10 pm

Re: realtime camera frame without IDE

Postby kwagyeman » Wed Dec 20, 2017 12:29 am

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.
Nyamekye,
jason.sjh7@gmail.com
Posts: 4
Joined: Tue Dec 19, 2017 4:50 am

Re: realtime camera frame without IDE

Postby jason.sjh7@gmail.com » Wed Dec 20, 2017 1:48 am

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_GO3c ... sp=sharing

But I want to get only realtime camera frame without 'OpenmvIDE'

for example :
ex1
https://drive.google.com/file/d/10FU2kh ... sp=sharing
How can I get realtime camera frame like 'ex1' ?
User avatar
kwagyeman
Posts: 2286
Joined: Sun May 24, 2015 2:10 pm

Re: realtime camera frame without IDE

Postby kwagyeman » Wed Dec 20, 2017 2:40 am

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.
Nyamekye,
jason.sjh7@gmail.com
Posts: 4
Joined: Tue Dec 19, 2017 4:50 am

Re: realtime camera frame without IDE

Postby jason.sjh7@gmail.com » Wed Dec 20, 2017 3:10 am

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/m ... enmv-fb.py

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

Code: Select all

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
User avatar
kwagyeman
Posts: 2286
Joined: Sun May 24, 2015 2:10 pm

Re: realtime camera frame without IDE

Postby kwagyeman » Wed Dec 20, 2017 3:41 am

Ibrahim just fixed this script. Um, let me ping him. It should be able to give you a frame however.
Nyamekye,
User avatar
iabdalkader
Posts: 550
Joined: Sun May 24, 2015 3:53 pm

Re: realtime camera frame without IDE

Postby iabdalkader » Wed Dec 20, 2017 10:09 am

Hi, please use the latest script from the repo:

https://raw.githubusercontent.com/openm ... enmv-fb.py

And run it using Python2
jason.sjh7@gmail.com
Posts: 4
Joined: Tue Dec 19, 2017 4:50 am

Re: realtime camera frame without IDE

Postby jason.sjh7@gmail.com » Wed Dec 20, 2017 10:57 am

@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 ?
User avatar
iabdalkader
Posts: 550
Joined: Sun May 24, 2015 3:53 pm

Re: realtime camera frame without IDE

Postby iabdalkader » Wed Dec 20, 2017 3:16 pm

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

Return to “General Topics”

Who is online

Users browsing this forum: No registered users and 3 guests