<?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/779" />

	<title>StereoPi Forum</title>
	<subtitle>StereoPi Forum</subtitle>
	<link href="https://forum.stereopi.com/index.php" />
	<updated>2019-10-15T08:48:11+00:00</updated>

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

		<entry>
		<author><name><![CDATA[Realizator]]></name></author>
		<updated>2019-10-15T08:48:11+00:00</updated>

		<published>2019-10-15T08:48:11+00:00</published>
		<id>https://forum.stereopi.com/viewtopic.php?p=1336#p1336</id>
		<link href="https://forum.stereopi.com/viewtopic.php?p=1336#p1336"/>
		<title type="html"><![CDATA[Re: rotate video 180 degrees?]]></title>

		
		<content type="html" xml:base="https://forum.stereopi.com/viewtopic.php?p=1336#p1336"><![CDATA[
cjonesy20, if any of my suggested steps works for you?<p>Statistics: Posted by <a href="https://forum.stereopi.com/memberlist.php?mode=viewprofile&amp;u=2">Realizator</a> — Tue Oct 15, 2019 8:48 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Realizator]]></name></author>
		<updated>2019-10-11T11:52:19+00:00</updated>

		<published>2019-10-11T11:52:19+00:00</published>
		<id>https://forum.stereopi.com/viewtopic.php?p=1329#p1329</id>
		<link href="https://forum.stereopi.com/viewtopic.php?p=1329#p1329"/>
		<title type="html"><![CDATA[Re: rotate video 180 degrees?]]></title>

		
		<content type="html" xml:base="https://forum.stereopi.com/viewtopic.php?p=1329#p1329"><![CDATA[
Next part.<br>As you know, we have some newer code, posted here <a href="https://github.com/realizator/stereopi-fisheye-robot" class="postlink">https://github.com/realizator/stereopi-fisheye-robot</a><br>Please notice, that for this experimrnt I've used new <a href="https://drive.google.com/file/d/1eIt-qJDd_aeyK72cqOgRzUGfm5TZmfMD/view?usp=sharing" class="postlink">Buster OpenCV image</a>. You can find this link in GitHub repo too.<br><br>I can suggest, that having V2 cameras you think, that this "fisheye" code is not your case. Actually this code works for the "classic FOV" cameras too, AND support fisheye cameras.<br>As I mentioned in related <a href="https://medium.com/stereopi/a-robot-on-stereopi-part-1-fisheye-cameras-92aa56e73a94" class="postlink">article</a>, this code has some important updates, like "all code inside" instead of using external calibration libraries. Also we used some tricks to increase calibration quality.<br><br>So I decided to suggest your images as an input for this code.<br><br>One notice. For improving chessboard detection quality we use a trick. For finding chessboard corners we use images with twice bigger resolution, and after that we decrease both X and Y coordinates of every corner twice, and use that data. So 4th script in this repo actually uses images with bigger resolution (taken in script 2_chess_cycle.py).<br>But your set has lower resolution, so to make your images set "compatible" I've commented this tricky code. I mean rows from 124 and up to 131.<br>Here is a screenshot before commenting:<br><img src="http://stereopi.com/sites/default/files/cjonesy20/2019-09-12-045303_1824x984_scrot.png" class="postimage" alt="Image"><br><br><br>And screenshot after:<br><img src="http://stereopi.com/sites/default/files/cjonesy20/2019-09-12-045235_1824x984_scrot.png" class="postimage" alt="Image"><br><br>Also original version of this script use file name "scene_1280x480_1.png" in a row 58 to show you final result. I changed it to "scene_640x240_1.png"<br><br>And here is the result of fisheye-enabled calibration:<br><img src="http://stereopi.com/sites/default/files/cjonesy20/2019-09-12-050004_1824x984_scrot.png" class="postimage" alt="Image"><br>Full resolution image: <a href="http://stereopi.com/sites/default/files/cjonesy20/2019-09-12-050004_1824x984_scrot.png" class="postlink">http://stereopi.com/sites/default/files ... _scrot.png</a><br><br>First line with the 2 images shows last two chessboard detections.<br>Second line with 2 images (Left_UNDISTORTED and Right_UNDISTORTED) shows you images after removing fisheye distortion. It's fun, but actually even V2 cameras has a small fisheye distortion  <img class="smilies" src="https://forum.stereopi.com/images/smilies/icon_e_biggrin.gif" width="15" height="17" alt=":D" title="Very Happy"> <br>And the last line with 2 images (Left STEREO CALIBRATED and Right STEREO CALIBRATED) shows you two images, rectified as a stereopair.<br><br>Brief conclusion: you may use our newest fisheye code to work with your non-fisheye cameras! <img class="smilies" src="https://forum.stereopi.com/images/smilies/icon_e_smile.gif" width="15" height="17" alt=":-)" title="Smile"><p>Statistics: Posted by <a href="https://forum.stereopi.com/memberlist.php?mode=viewprofile&amp;u=2">Realizator</a> — Fri Oct 11, 2019 11:52 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Realizator]]></name></author>
		<updated>2019-10-11T11:17:50+00:00</updated>

		<published>2019-10-11T11:17:50+00:00</published>
		<id>https://forum.stereopi.com/viewtopic.php?p=1328#p1328</id>
		<link href="https://forum.stereopi.com/viewtopic.php?p=1328#p1328"/>
		<title type="html"><![CDATA[Re: rotate video 180 degrees?]]></title>

		
		<content type="html" xml:base="https://forum.stereopi.com/viewtopic.php?p=1328#p1328"><![CDATA[
cjonesy20, i did some experiments for you. <br>As I have a lot to say, let me post my answer in a several consequent posts here.<br><br><strong class="text-strong">1. Experiment conditions</strong><br>For this test I used micro SD with fresh-recorded image downloaded <a href="https://drive.google.com/file/d/1sM37cT6dTlZHhSRIz4Z9oEJk_xbR7pLL/view" class="postlink">here</a>.<br>This image contains code from <a href="https://github.com/realizator/stereopi-tutorial" class="postlink">https://github.com/realizator/stereopi-tutorial</a>, and here is <a href="https://medium.com/stereopi/opencv-and-depth-map-on-stereopi-tutorial-62cb6792bbed" class="postlink">related article in our blog</a>.<br><br>I DID NOT change any code. I just deleted both "pairs" and "scenes" folders with images, and put two these folders from your link.<br><br><strong class="text-strong">2. After step 1:</strong><br>I did "cd stereopi-tutorial" and run this command:<div class="codebox"><p>Code: </p><pre><code>4_calibration.py</code></pre></div>Here is the result:<br><img src="http://stereopi.com/sites/default/files/cjonesy20/cjonesy20-calibrated.png" class="postimage" alt="Image"><br><br>Here is a full screenshot:<br><img src="http://stereopi.com/sites/default/files/cjonesy20/2019-04-03-060132_1824x984_scrot.png" class="postimage" alt="Image"><br><br>It means that with the default setting this calibration works fine. But let's look into details.<br><br><strong class="text-strong">3. Chessboard detection</strong><br>4th script shows you calibration images while processing folders, and also shows corners detected. This is a critical point, and you should look at these images to control quality. If chessboard is detected wrong, this will affect on calibration quality. I recommend to delete images with wrong corners detection.<br><br>I did a series of screenshots and combined some "good" and "bad" images for comparison.<br><br>Here are the samples with "good" detection:<br>(Link to full-res image: <a href="http://stereopi.com/sites/default/files/cjonesy20/cjonesy-good-chessboard.png" class="postlink">http://stereopi.com/sites/default/files ... sboard.png</a>)<br><img src="http://stereopi.com/sites/default/files/cjonesy20/cjonesy-good-chessboard.png" class="postimage" alt="Image"><br><br><br>And some "bad" detection samples:<br>(Link to full-resolution image: <a href="http://stereopi.com/sites/default/files/cjonesy20/cjonesy-bad-chessboard.png" class="postlink">http://stereopi.com/sites/default/files ... sboard.png</a>)<br><img src="http://stereopi.com/sites/default/files/cjonesy20/cjonesy-bad-chessboard.png" class="postimage" alt="Image"><br><br><br>You may find, that on "bad" detections some corners was not found, or found in a wrong place. Also colors lines sometimes are not straight, but zig-zag like.<br>In spite of this wrong detections, final result is acceptable.<br>As for calibration we use a low resolution, I'd recomment you to keep board closer to the cameras.<br>If you wish to analyze all images I mentioned, you can download <a href="http://stereopi.com/sites/default/files/cjonesy20/scrots.zip" class="postlink">this ZIP file with all screenshots</a>. You can find a name of every image (printed by 4th script in the terminal) and also image itself. <br><br>This is the first part of my answer.<p>Statistics: Posted by <a href="https://forum.stereopi.com/memberlist.php?mode=viewprofile&amp;u=2">Realizator</a> — Fri Oct 11, 2019 11:17 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Realizator]]></name></author>
		<updated>2019-10-10T20:16:39+00:00</updated>

		<published>2019-10-10T20:16:39+00:00</published>
		<id>https://forum.stereopi.com/viewtopic.php?p=1319#p1319</id>
		<link href="https://forum.stereopi.com/viewtopic.php?p=1319#p1319"/>
		<title type="html"><![CDATA[Re: rotate video 180 degrees?]]></title>

		
		<content type="html" xml:base="https://forum.stereopi.com/viewtopic.php?p=1319#p1319"><![CDATA[
From the first view I see your left image is actually right image (after all rotation/flip procedures).<br>You need to fix it in script 4. You can do it in a lot of places. For example, in rows 55 and 56 you can "swap" them. That is replace this code<div class="codebox"><p>Code: </p><pre><code>  leftName = './pairs/left_'+str(photo_counter).zfill(2)+'.png'  rightName = './pairs/right_'+str(photo_counter).zfill(2)+'.png'</code></pre></div>to this:<br><div class="codebox"><p>Code: </p><pre><code>  rightName = './pairs/left_'+str(photo_counter).zfill(2)+'.png'  leftName  = './pairs/right_'+str(photo_counter).zfill(2)+'.png'</code></pre></div>Also I see some issues with sticking chessboard, and in some cases chessboard is too far from the camera. As a rule, in such a cases calibration script can not find chessboard on the image, or find it incorrectly. By the way, are chessboard corners highlighted correctly while import procedure in the 4th script?<br><br>Tomorrow I will have access to my test equipment, and I can give you come more details after running a scripts on your set of photos.<p>Statistics: Posted by <a href="https://forum.stereopi.com/memberlist.php?mode=viewprofile&amp;u=2">Realizator</a> — Thu Oct 10, 2019 8:16 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[cjonesy20]]></name></author>
		<updated>2019-10-10T19:43:10+00:00</updated>

		<published>2019-10-10T19:43:10+00:00</published>
		<id>https://forum.stereopi.com/viewtopic.php?p=1318#p1318</id>
		<link href="https://forum.stereopi.com/viewtopic.php?p=1318#p1318"/>
		<title type="html"><![CDATA[Re: rotate video 180 degrees?]]></title>

		
		<content type="html" xml:base="https://forum.stereopi.com/viewtopic.php?p=1318#p1318"><![CDATA[
<blockquote class="uncited"><div>Can you please upload your folder with images used for calibration to Google drive (or alternative storage) and share it with me? I'll try to analyze them.</div></blockquote><a href="https://drive.google.com/open?id=1fVzBFDGMKZzrwTY2QuEXtFy_divAcHqB" class="postlink">https://drive.google.com/open?id=1fVzBF ... y_divAcHqB</a><p>Statistics: Posted by <a href="https://forum.stereopi.com/memberlist.php?mode=viewprofile&amp;u=255">cjonesy20</a> — Thu Oct 10, 2019 7:43 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[cjonesy20]]></name></author>
		<updated>2019-10-10T19:33:25+00:00</updated>

		<published>2019-10-10T19:33:25+00:00</published>
		<id>https://forum.stereopi.com/viewtopic.php?p=1317#p1317</id>
		<link href="https://forum.stereopi.com/viewtopic.php?p=1317#p1317"/>
		<title type="html"><![CDATA[Re: rotate video 180 degrees?]]></title>

		
		<content type="html" xml:base="https://forum.stereopi.com/viewtopic.php?p=1317#p1317"><![CDATA[
I'll try the flip options but for now I've got the case flipped upside down. When I run script 5 it's not taking a picture of what's currently in front of the camera. It's using photo.png from scenes but it's way zoomed in. How do I take a new stereo picture and have script 5 use it? <br><br>Also I don't see anything documented on how to save video to a file.<p>Statistics: Posted by <a href="https://forum.stereopi.com/memberlist.php?mode=viewprofile&amp;u=255">cjonesy20</a> — Thu Oct 10, 2019 7:33 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Realizator]]></name></author>
		<updated>2019-10-10T19:31:00+00:00</updated>

		<published>2019-10-10T19:31:00+00:00</published>
		<id>https://forum.stereopi.com/viewtopic.php?p=1316#p1316</id>
		<link href="https://forum.stereopi.com/viewtopic.php?p=1316#p1316"/>
		<title type="html"><![CDATA[Re: rotate video 180 degrees?]]></title>

		
		<content type="html" xml:base="https://forum.stereopi.com/viewtopic.php?p=1316#p1316"><![CDATA[
Can you please upload your folder with images used for calibration to Google drive (or alternative storage) and share it with me? I'll try to analyze them.<p>Statistics: Posted by <a href="https://forum.stereopi.com/memberlist.php?mode=viewprofile&amp;u=2">Realizator</a> — Thu Oct 10, 2019 7:31 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[cjonesy20]]></name></author>
		<updated>2019-10-10T19:11:03+00:00</updated>

		<published>2019-10-10T19:11:03+00:00</published>
		<id>https://forum.stereopi.com/viewtopic.php?p=1315#p1315</id>
		<link href="https://forum.stereopi.com/viewtopic.php?p=1315#p1315"/>
		<title type="html"><![CDATA[Re: rotate video 180 degrees?]]></title>

		
		<content type="html" xml:base="https://forum.stereopi.com/viewtopic.php?p=1315#p1315"><![CDATA[
I flipped the case upside down, removed the rotation = 180 code and ran through everything again. On the calibration step the final two calibrated images look fish eye (this is a V2.1 Raspberry Pi Cam, no fish eye).<p>Statistics: Posted by <a href="https://forum.stereopi.com/memberlist.php?mode=viewprofile&amp;u=255">cjonesy20</a> — Thu Oct 10, 2019 7:11 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Realizator]]></name></author>
		<updated>2019-10-10T18:50:09+00:00</updated>

		<published>2019-10-10T18:50:09+00:00</published>
		<id>https://forum.stereopi.com/viewtopic.php?p=1312#p1312</id>
		<link href="https://forum.stereopi.com/viewtopic.php?p=1312#p1312"/>
		<title type="html"><![CDATA[Re: rotate video 180 degrees?]]></title>

		
		<content type="html" xml:base="https://forum.stereopi.com/viewtopic.php?p=1312#p1312"><![CDATA[
As you mentioned 6 scripts, I can suggest you're using a code from this repo: <a href="https://github.com/realizator/stereopi-tutorial" class="postlink">https://github.com/realizator/stereopi-tutorial</a><br><br>If you look inside the first script, you can find this row:<div class="codebox"><p>Code: </p><pre><code>camera.hflip = True</code></pre></div>This option do horizontal flip for each image.<br><br>You can also use another option:<div class="codebox"><p>Code: </p><pre><code>camera.vflip = True</code></pre></div>This will flip image vertically.<p>Statistics: Posted by <a href="https://forum.stereopi.com/memberlist.php?mode=viewprofile&amp;u=2">Realizator</a> — Thu Oct 10, 2019 6:50 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[cjonesy20]]></name></author>
		<updated>2019-10-10T18:43:55+00:00</updated>

		<published>2019-10-10T18:43:55+00:00</published>
		<id>https://forum.stereopi.com/viewtopic.php?p=1311#p1311</id>
		<link href="https://forum.stereopi.com/viewtopic.php?p=1311#p1311"/>
		<title type="html"><![CDATA[Re: rotate video 180 degrees?]]></title>

		
		<content type="html" xml:base="https://forum.stereopi.com/viewtopic.php?p=1311#p1311"><![CDATA[
When I added this code in the scripts and then ran through steps 1 to 6 the final depth map is completely trash so it doesn't look like it worked. <br><br>Any suggestions on how to rotate the image 180 degrees? Here's a picture of how they are mounted. The connector on each camera is on the top. It seemed like the most natural way to mount it but it made all the scripts show up upside down.<dl class="file"><dt class="attach-image"><img src="https://forum.stereopi.com/download/file.php?id=41" class="postimage" alt="IMG_20191010_102012.jpg" onclick="viewableArea(this);" /></dt></dl><p>Statistics: Posted by <a href="https://forum.stereopi.com/memberlist.php?mode=viewprofile&amp;u=255">cjonesy20</a> — Thu Oct 10, 2019 6:43 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Realizator]]></name></author>
		<updated>2019-10-10T07:59:28+00:00</updated>

		<published>2019-10-10T07:59:28+00:00</published>
		<id>https://forum.stereopi.com/viewtopic.php?p=1306#p1306</id>
		<link href="https://forum.stereopi.com/viewtopic.php?p=1306#p1306"/>
		<title type="html"><![CDATA[Re: rotate video 180 degrees?]]></title>

		
		<content type="html" xml:base="https://forum.stereopi.com/viewtopic.php?p=1306#p1306"><![CDATA[
Please notice, that if you are working in stereoscopic mode, this rotation is implemented to each camera image independently, but not for the final stitched stereoscopic image. It means that this rotation actually swaps your left and right cameras.<p>Statistics: Posted by <a href="https://forum.stereopi.com/memberlist.php?mode=viewprofile&amp;u=2">Realizator</a> — Thu Oct 10, 2019 7:59 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[cjonesy20]]></name></author>
		<updated>2019-10-09T20:23:27+00:00</updated>

		<published>2019-10-09T20:23:27+00:00</published>
		<id>https://forum.stereopi.com/viewtopic.php?p=1301#p1301</id>
		<link href="https://forum.stereopi.com/viewtopic.php?p=1301#p1301"/>
		<title type="html"><![CDATA[Re: rotate video 180 degrees?]]></title>

		
		<content type="html" xml:base="https://forum.stereopi.com/viewtopic.php?p=1301#p1301"><![CDATA[
Found it! I added this to the script:<br><div class="codebox"><p>Code: </p><pre><code>camera.rotation = 180</code></pre></div><p>Statistics: Posted by <a href="https://forum.stereopi.com/memberlist.php?mode=viewprofile&amp;u=255">cjonesy20</a> — Wed Oct 09, 2019 8:23 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[cjonesy20]]></name></author>
		<updated>2019-10-09T20:19:26+00:00</updated>

		<published>2019-10-09T20:19:26+00:00</published>
		<id>https://forum.stereopi.com/viewtopic.php?p=1300#p1300</id>
		<link href="https://forum.stereopi.com/viewtopic.php?p=1300#p1300"/>
		<title type="html"><![CDATA[rotate video 180 degrees?]]></title>

		
		<content type="html" xml:base="https://forum.stereopi.com/viewtopic.php?p=1300#p1300"><![CDATA[
Is it possible to rotate the video 180 degrees? The way I had to mount the cameras in my case has the image upside down.<p>Statistics: Posted by <a href="https://forum.stereopi.com/memberlist.php?mode=viewprofile&amp;u=255">cjonesy20</a> — Wed Oct 09, 2019 8:19 pm</p><hr />
]]></content>
	</entry>
	</feed>
