<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.stereopi.com/app.php/feed/topic/1035" />

	<title>StereoPi Forum</title>
	<subtitle>StereoPi Forum</subtitle>
	<link href="https://forum.stereopi.com/index.php" />
	<updated>2020-10-26T13:43:59+00:00</updated>

	<author><name><![CDATA[StereoPi Forum]]></name></author>
	<id>https://forum.stereopi.com/app.php/feed/topic/1035</id>

		<entry>
		<author><name><![CDATA[Realizator]]></name></author>
		<updated>2020-10-26T13:43:59+00:00</updated>

		<published>2020-10-26T13:43:59+00:00</published>
		<id>https://forum.stereopi.com/viewtopic.php?p=2331#p2331</id>
		<link href="https://forum.stereopi.com/viewtopic.php?p=2331#p2331"/>
		<title type="html"><![CDATA[Re: StereoPi max resolution]]></title>

		
		<content type="html" xml:base="https://forum.stereopi.com/viewtopic.php?p=2331#p2331"><![CDATA[
p.s. ciltatarza, could you please contact me by email? I have one ROS-specific question for you... my email is my nickname @gmail.com<p>Statistics: Posted by <a href="https://forum.stereopi.com/memberlist.php?mode=viewprofile&amp;u=2">Realizator</a> — Mon Oct 26, 2020 1:43 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Realizator]]></name></author>
		<updated>2020-10-23T16:40:42+00:00</updated>

		<published>2020-10-23T16:40:42+00:00</published>
		<id>https://forum.stereopi.com/viewtopic.php?p=2313#p2313</id>
		<link href="https://forum.stereopi.com/viewtopic.php?p=2313#p2313"/>
		<title type="html"><![CDATA[Re: StereoPi max resolution]]></title>

		
		<content type="html" xml:base="https://forum.stereopi.com/viewtopic.php?p=2313#p2313"><![CDATA[
ciltatarza, you wrote "I need to quality images so i set to use_video_port=False."<br>This is the key point here. In this mode (actually "still image mode"), GPU does A LOT of image improvements (like noise cancellation, color adjustments etc.). So this mode can't be used for the fast frames capture, even theoretically. Please try to use this in "use_video_port=False" mode.<br><br>If you are an experienced Python/CPP user, I can give you 3 points for consideration. I tested them all, and will implement one of these in our upcoming update of the Python code.<br><br>1. You can try to use threads to capture images in Python, as it helps to avoid waiting for the IO operations. This can increase FPS ~2-3 times. As a negative effect - your CPU will be loaded up to 100% for all 4 kernels. The explanation can be found <a href="https://www.pyimagesearch.com/2015/12/28/increasing-raspberry-pi-fps-with-python-and-opencv/" class="postlink">here</a>.<br>I attached an example of the code I used to play with (FPS_test_basic.py.zip). You can try to change the resolution and see the result.<br><br>2. You can try to use "np.frombuffer" feature in Python. It will create frames in memory, without copying/modifying them. Also, you can use YUV colorspace, and take Y (Intensity) only - i.e. 3 times smaller amount of data. I.e. in this case camera provide you a color image in the memory, but you are using the grayscale part only. This is the approach I will use in our scripts. Take a look at the explanation and a code example (the second code in the first answer) <a href="https://raspberrypi.stackexchange.com/questions/58871/pi-camera-v2-fast-full-sensor-capture-mode-with-downsampling" class="postlink">here</a>. JFYI, the author of this answer is actually an author of the PiCamera python library. <img class="smilies" src="https://forum.stereopi.com/images/smilies/icon_e_smile.gif" width="15" height="17" alt=":-)" title="Smile"><br><br>3. C++ and the most efficient way. In addition to the raspivid, we have raspividyuv utility. It has one extremely useful parameter, "--luma" or "-l". If you use it, raspividyuv will give you ONLY the Y parameter (i.e. grayscale image). It means IO process will not use the bandwidth, needed to push a full color image.<br>So you can use this utility and pass all frames to your processing part over a pipe. We used exactly this trick in <a href="https://stereopi.com/blog/opencv-comparing-speed-c-and-python-code-raspberry-pi-stereo-vision" class="postlink">our article</a> about C++/Python speed comparison. <br><br><br>Which approach looks more interesting to you? <img class="smilies" src="https://forum.stereopi.com/images/smilies/icon_e_smile.gif" width="15" height="17" alt=":-)" title="Smile"><br><br>p.s. raspividyuv got the stereoscopis support just a few months ago. please use the latest firmware/kernel to get stereoscopic image from raspividyuv<dl class="file"><dt><span class="imageset icon_topic_attach"></span> <a class="postlink" href="https://forum.stereopi.com/download/file.php?id=161">FPS_test_basic.py.zip</a></dt></dl><p>Statistics: Posted by <a href="https://forum.stereopi.com/memberlist.php?mode=viewprofile&amp;u=2">Realizator</a> — Fri Oct 23, 2020 4:40 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ciltatarza]]></name></author>
		<updated>2020-10-23T14:37:56+00:00</updated>

		<published>2020-10-23T14:37:56+00:00</published>
		<id>https://forum.stereopi.com/viewtopic.php?p=2312#p2312</id>
		<link href="https://forum.stereopi.com/viewtopic.php?p=2312#p2312"/>
		<title type="html"><![CDATA[Re: StereoPi max resolution]]></title>

		
		<content type="html" xml:base="https://forum.stereopi.com/viewtopic.php?p=2312#p2312"><![CDATA[
Hi the lighter!<br><br>I inspect your some blogs.<br><div class="codebox"><p>Code: </p><pre><code>Why do we use BGRA capture, but not BGR?As we mentioned before, we resize the images using the GPU, and a native GPU format is BGRA (or RGBA, as you wish). If you use BGR you will find two issues; the first is a lower FPS (about 10–20% in our case) and the second is a PiCamera warning «PiCameraAlfaStripping: using alpha-stripping to convert to non-alpha format; you may find equivalent alpha format faster”. Googling this error led us to PiCamera documentation where we found the BGRA method.</code></pre></div>I will update the code through this information. But I'll still be waiting your advice.<p>Statistics: Posted by <a href="https://forum.stereopi.com/memberlist.php?mode=viewprofile&amp;u=627">ciltatarza</a> — Fri Oct 23, 2020 2:37 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ciltatarza]]></name></author>
		<updated>2020-10-23T11:47:13+00:00</updated>

		<published>2020-10-23T11:47:13+00:00</published>
		<id>https://forum.stereopi.com/viewtopic.php?p=2311#p2311</id>
		<link href="https://forum.stereopi.com/viewtopic.php?p=2311#p2311"/>
		<title type="html"><![CDATA[Re: StereoPi max resolution]]></title>

		
		<content type="html" xml:base="https://forum.stereopi.com/viewtopic.php?p=2311#p2311"><![CDATA[
Hi a little car and a lighter!<br><br>I have a slave and a master.<br>Slave is StereoPi (compute module v3) and I use ROS.<br><br>I want to publish stereo images from slave to master via ethernet cable.<br><br>Now the whole system is ready. ( e.g. master and slave communication, ros )<br><br>I can use python and c++. It doesn't matter.<br><br>Sample code that I have ;<br><div class="codebox"><p>Code: </p><pre><code>        cam_width = 640*4    cam_height = 480*2    scale_ratio = 0.5    # Buffer for captured image settings    img_width = int (cam_width * scale_ratio)    img_height = int (cam_height * scale_ratio)    capture = np.zeros((img_height*img_width*3), dtype=np.uint8)        # Initialize the camera    camera = PiCamera(stereo_mode='side-by-side', stereo_decimate=False)    camera.resolution=(cam_width, cam_height)    camera.framerate = 20    camera.hflip = True    camera.vflip = True        for frame in camera.capture_continuous(capture, format="bgr", use_video_port=False, resize=(img_width,img_height)):        frame = frame.reshape((480, 1280, 3))        imgL = frame[0:img_height, 0:img_width/2]        imgR = frame[0:img_height, img_width/2:img_width]    </code></pre></div>I need to quality images so i set to use_video_port=False.<br>That code runs with 1-2 FPS and 640x480 resolution for each image. But i need to high resolution and acceptable FPS(at least 3-5 FPS).<br><br>I use raspberry pi camera V2 and Ubuntu Mate.I do not use GUI.<br><br>I think I can not publish images with SLP.<br><br><br>Thanks for reply.<p>Statistics: Posted by <a href="https://forum.stereopi.com/memberlist.php?mode=viewprofile&amp;u=627">ciltatarza</a> — Fri Oct 23, 2020 11:47 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Realizator]]></name></author>
		<updated>2020-10-23T09:30:03+00:00</updated>

		<published>2020-10-23T09:30:03+00:00</published>
		<id>https://forum.stereopi.com/viewtopic.php?p=2307#p2307</id>
		<link href="https://forum.stereopi.com/viewtopic.php?p=2307#p2307"/>
		<title type="html"><![CDATA[Re: StereoPi max resolution]]></title>

		
		<content type="html" xml:base="https://forum.stereopi.com/viewtopic.php?p=2307#p2307"><![CDATA[
Hi ciltatarza,<br>Could you please tell us more details?<br>Are you plan to capture these images by Python for further processing? Or you are trying to record this video using SLP image and create a video file?<br>Which cameras you are using? (v1/v2/HQ?)<p>Statistics: Posted by <a href="https://forum.stereopi.com/memberlist.php?mode=viewprofile&amp;u=2">Realizator</a> — Fri Oct 23, 2020 9:30 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ciltatarza]]></name></author>
		<updated>2020-10-22T06:57:44+00:00</updated>

		<published>2020-10-22T06:57:44+00:00</published>
		<id>https://forum.stereopi.com/viewtopic.php?p=2304#p2304</id>
		<link href="https://forum.stereopi.com/viewtopic.php?p=2304#p2304"/>
		<title type="html"><![CDATA[StereoPi max resolution]]></title>

		
		<content type="html" xml:base="https://forum.stereopi.com/viewtopic.php?p=2304#p2304"><![CDATA[
Hi folks,<br><br>I want to capture two 1920x1440 images but i get black screen when i try it.<br><br>5 or 10 fps is enough for me.<br><br>Is it possible ?<br><br>If possible, would you send sample code  <img class="smilies" src="https://forum.stereopi.com/images/smilies/icon_question.gif" width="15" height="17" alt=":?:" title="Question"> <br><br>Thanks in advance <img class="smilies" src="https://forum.stereopi.com/images/smilies/icon_exclaim.gif" width="15" height="17" alt=":!:" title="Exclamation"><p>Statistics: Posted by <a href="https://forum.stereopi.com/memberlist.php?mode=viewprofile&amp;u=627">ciltatarza</a> — Thu Oct 22, 2020 6:57 am</p><hr />
]]></content>
	</entry>
	</feed>
