Raspividyuv stereo

OpenCV, Python and other image processing questions
Post Reply
Michael93
Posts: 3
Joined: Sat Dec 14, 2019 12:12 pm

Raspividyuv stereo

Post by Michael93 »

Hello.

I am using your tutorial for using high framerate. Video stream there is captured using raspividyuv.

(w,h) = (640,480)
bytesPerFrame = w * h
fps = 250

videoCmd = "raspividyuv --stereo tb -ex off -w "+str(w)+" -h "+str(h)+" --output - --timeout 0 --framerate "+str(fps)+" --luma --nopreview"
videoCmd = videoCmd.split()

cameraProcess = sp.Popen(videoCmd, stdout=sp.PIPE, bufsize=0)

while True:
cameraProcess.stdout.flush()

frame = np.fromfile(cameraProcess.stdout, count=bytesPerFrame, dtype=np.uint8)
if frame.size != bytesPerFrame:
print("Error: Camera stream closed unexpectedly")
break
frame.shape = (h,w)
cv2.imshow("Frame", frame)

In my project, I need to gather frames from both cameras. Is there the possibility to do it using raspividyuv (this requirement is duo faster image capturing)?

User avatar
Realizator
Site Admin
Posts: 588
Joined: Tue Apr 16, 2019 9:23 am
Contact:

Re: Raspividyuv stereo

Post by Realizator »

Hi Michael93,
Actually this is not my tutorial, I just found this code at GitHub. :-)
I have several notices here:
1. Actually, raspividyuv has not stereoscopic support. It was added several months ago, and to add it to your Raspbian you need to do sudo rpi-update
2. 250 FPS is too fast for the stereoscopic mode. We've tested it with 1280x480 and C code on receiving part, and was able to get 89FPS We're planning to publish our code and article in the nearest week.
3. If you'll try to use another resolutions for the stereoscopic capture, please remember that it is better to set horisontal resolution for each image dividable by 128 to avoid capture issues.
Eugene a.k.a. Realizator

Michael93
Posts: 3
Joined: Sat Dec 14, 2019 12:12 pm

Re: Raspividyuv stereo

Post by Michael93 »

Hello.

"2. 250 FPS is too fast for the stereoscopic mode. We've tested it with 1280x480 and C code on receiving part, and was able to get 89FPS We're planning to publish our code and article in the nearest week."

Actually, I do not need 250FPS, 90FPS is perfect. I wait for publication of the article :) Where it will be published?

zoldaten
Posts: 21
Joined: Fri Apr 26, 2019 7:07 am

Re: Raspividyuv stereo

Post by zoldaten »

Have a look here - https://gist.github.com/CarlosGS/b8462a ... bb0f3a4d63

But i didnt get code working well (

User avatar
Realizator
Site Admin
Posts: 588
Joined: Tue Apr 16, 2019 9:23 am
Contact:

Re: Raspividyuv stereo

Post by Realizator »

Zoldaten, this code works, but need some fixes. You can find my comment in the mentioned thread.
Actually author uses 250 FPS settings to get the maximum from the camera.
Eugene a.k.a. Realizator

zoldaten
Posts: 21
Joined: Fri Apr 26, 2019 7:07 am

Re: Raspividyuv stereo

Post by zoldaten »

got it working at last !
90 fps, single (not stereo mode)

User avatar
Realizator
Site Admin
Posts: 588
Joined: Tue Apr 16, 2019 9:23 am
Contact:

Re: Raspividyuv stereo

Post by Realizator »

Congratulations! :-)
Eugene a.k.a. Realizator

Post Reply