Welcome new user! You can search existing questions and answers without registering, but please register to post new questions and receive answers. Note that due to large amounts of spam attempts, your first three posts will be manually moderated, so please be patient.
Because of un-manageable amounts of spam despite our use of CAPTCHAs, email authorization, and other tools, we have discontinued this forum (see the 700k+ registered users with validated email addresses at right?). Please email us any questions or post bug reports and feature requests on GitHub at https://github.com/jevois -- The content below remains available for future reference.

Stream at lower resolution than acqusition?

0 votes
I program in Python. What I would like to do is acquire an image at 640x480. Process it for ArUco detection and pose.  Then I would like to stream the image out USB, but at a lower resolution of 320x240.

Even when I use the OpenCV "resize" command, I get an error message that JeVois can't send an image with a different size than it acquired it.

So, is there a way to do this?
asked Apr 29, 2018 in Programmer Questions by Billbo911 (1,110 points)

1 Answer

+1 vote
Best answer

Maybe your video mapping is wrong? You would need something like

YUYV 320 240 30.0 YUYV 640 480 30.0 JeVois MyPythonModule

which will output 320x240 video over USB while capturing 640x480 from the camera sensor.

then you would just resize your image to 320x240 and do an outframe.sendCvBGR(). Beware that OpenCV uses rows, columns (i.e., height, width) in some functions but width, height in others (like cv::Size), so maybe check the docs of the opencv resizing function to make sure width and height are not swapped.

If the problem persists, please post your mapping definition and python code and we can assist you further.

answered May 1, 2018 by JeVois (46,580 points)
selected May 3, 2018 by Billbo911
Thank you!! The issue was as simple as I had swapped the resolution in the video mapping file. I had "MJPG 640 480 24.0 YUYV 320 240 24.0 ......." I just swapped to "MJPG 320 240 24.0 YUYV 640 480 24.0...." and it worked as expected with the OpenCV Resize function.