pyopenmv support multiple camera

Discussion related to "under the hood" OpenMV topics.
skylin008
Posts: 63
Joined: Mon Mar 13, 2017 10:18 pm

pyopenmv support multiple camera

Postby skylin008 » Wed Nov 06, 2019 7:21 pm

Hello everyone! I have three opemmv board to detection left/right/up side object. I want to view every side image in pc via USB meantime.Does pyopenmv.py can be finish this function? Thanks advance!
User avatar
iabdalkader
Posts: 1143
Joined: Sun May 24, 2015 3:53 pm

Re: pyopenmv support multiple camera

Postby iabdalkader » Wed Nov 06, 2019 7:45 pm

Someone contributed this script, it supports multiple cameras:

https://github.com/openmv/openmv/blob/m ... v_multi.py
skylin008
Posts: 63
Joined: Mon Mar 13, 2017 10:18 pm

Re: pyopenmv support multiple camera

Postby skylin008 » Thu Nov 07, 2019 6:43 am

OK.Thanks !@ iabdalkader
skylin008
Posts: 63
Joined: Mon Mar 13, 2017 10:18 pm

Re: pyopenmv support multiple camera

Postby skylin008 » Tue Nov 12, 2019 2:01 am

Hello iabdalkader! I used the Pyopenmv_multi.Py script On Win10 system and Python2.7 version.But when run the script,Nothing information shows at CMD console or show any Windows. What is issue there?Thanks!
User avatar
iabdalkader
Posts: 1143
Joined: Sun May 24, 2015 3:53 pm

Re: pyopenmv support multiple camera

Postby iabdalkader » Tue Nov 12, 2019 9:47 am

skylin008 wrote:
Tue Nov 12, 2019 2:01 am
Hello iabdalkader! I used the Pyopenmv_multi.Py script On Win10 system and Python2.7 version.But when run the script,Nothing information shows at CMD console or show any Windows. What is issue there?Thanks!
I haven't tested these scripts on Windows, I'm not sure if they work on Windows. Please try the script on Linux.
skylin008
Posts: 63
Joined: Mon Mar 13, 2017 10:18 pm

Re: pyopenmv support multiple camera

Postby skylin008 » Wed Nov 13, 2019 5:01 am

Thanks iabdalkader kindly reply.Today, I Test it at ubuntu 16.04 platfrom and python2.7.12.Nothing information show same as win10 system.Can you be try at your linux system?Thanks!

Code: Select all

sudo python pyopenmv_multi.py /dev/ttyACM0 test.py
User avatar
iabdalkader
Posts: 1143
Joined: Sun May 24, 2015 3:53 pm

Re: pyopenmv support multiple camera

Postby iabdalkader » Wed Nov 13, 2019 5:10 pm

skylin008 wrote:
Wed Nov 13, 2019 5:01 am
Thanks iabdalkader kindly reply.Today, I Test it at ubuntu 16.04 platfrom and python2.7.12.Nothing information show same as win10 system.Can you be try at your linux system?Thanks!

Code: Select all

sudo python pyopenmv_multi.py /dev/ttyACM0 test.py
What information do you expect to see ? It just runs test.py. What is in test.py ?
skylin008
Posts: 63
Joined: Mon Mar 13, 2017 10:18 pm

Re: pyopenmv support multiple camera

Postby skylin008 » Wed Nov 13, 2019 7:12 pm

Thanks iabdalkader ! The test.py as follow:

Code: Select all

 import sensor, image, time

sensor.reset()                      # Reset and initialize the sensor.
sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE)
sensor.set_framesize(sensor.QVGA)   # Set frame size to QVGA (320x240)
sensor.skip_frames(time = 2000)     # Wait for settings take effect.
clock = time.clock()                # Create a clock object to track the FPS.

while(True):
    clock.tick()                    # Update the FPS clock.
    img = sensor.snapshot()         # Take a picture and return the image.
    print(clock.fps())              # Note: OpenMV Cam runs about half as fast when connected
                                    # to the IDE. The FPS should increase once disconnected.
I had installed three openmv4 at pc, want to showing the three image information same time, needed the function same as pyopenmv_fb.py script. Thanks!
User avatar
iabdalkader
Posts: 1143
Joined: Sun May 24, 2015 3:53 pm

Re: pyopenmv support multiple camera

Postby iabdalkader » Thu Nov 14, 2019 10:58 am

It's working, but it only runs the script for 250ms and then tries to read the text buffer if there's any output, so you won't always see output. This is just the test mode, you should import this module and write your own script if you want to run scripts and wait for output, read the framebuffer etc..

Return to “Technical Discussion”

Who is online

Users browsing this forum: MSN [Bot] and 6 guests