<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta content="text/html;charset=UTF-8" http-equiv="Content-Type"></head><body ><div style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt;"><div>Hi,<br></div><div><br></div><div>the 3rd argument was actually for an older version of imrotate which the function is in pure Scilab script, however, it has not been used when we move to opencv implementation. <br></div><div><br></div><div>please make a report here : <a href="https://github.com/tanchinluh/IPCV" target="_blank">https://github.com/tanchinluh/IPCV</a> so that we could put it into our future release. <br></div><div><br></div><div>Thanks.<br></div><div><br></div><div>Regards,<br></div><div>Chin Luh</div><br><div data-zbluepencil-ignore="true" style="" class="zmail_extra"><br><div id="Zm-_Id_-Sgn1">---- On Wed, 24 Jun 2020 16:22:39 +0800 <b>P M <p.muehlmann@gmail.com></b> wrote ----<br></div><br><blockquote style="border-left: 1px solid rgb(204, 204, 204); padding-left: 6px; margin: 0px 0px 0px 5px;"><div><div dir="ltr"><div>Dear Experts,<br></div><div><br></div><div>using imrotate() from IPCV-toolbox:<br></div><div><br></div><div><div class="x_-1630845181gmail-refsynopsisdiv"><div class="x_-1630845181gmail-synopsis"><pre><span class="x_-1630845181gmail-default">imout = </span><span class="x_-1630845181gmail-functionid">imrotate</span><span class="x_-1630845181gmail-default">(im1,deg,crp)</span><br></pre></div></div></div><div><br></div><div><div class="x_-1630845181gmail-refsection"><dl><dt><span class="x_-1630845181gmail-term">crp : </span>Returns only central portion output image which is the same size
as source if set to 1<br></dt></dl><div><br></div><div>My input image is 512x512 pixel.<br></div><div><br></div><div>The output image shall be of the same size.<br></div><div><br></div><div>For this I try crop = 1 and also crop = 0<br></div><div><br></div><div>However the output image is always of different size, depending on the rotation value.<br></div><div><br></div><div>Do I misunderstand something?<br></div><div><br></div><div>Here my code:<br></div><div><br></div><div><pre style="font-family: Monospaced;font-style: normal;"><span class="colour" style="color:rgb(160, 32, 240)">for</span> <span class="colour" style="color:rgb(0, 0, 0)">i</span> <span class="colour" style="color:rgb(92, 92, 92)">=</span> <span class="colour" style="color:rgb(188, 143, 143)">1</span><span class="colour" style="color:rgb(255, 170, 0)">:</span><span class="colour" style="color:rgb(0, 0, 0)">nrOrigImg</span>
<span class="colour" style="color:rgb(0, 0, 0)">img</span> <span class="colour" style="color:rgb(92, 92, 92)">=</span> <span class="colour" style="color:rgb(174, 92, 176)"><u>imread</u></span><span class="colour" style="color:rgb(74, 85, 219)">(</span><span class="colour" style="color:rgb(0, 0, 0)">fpath_img</span><span class="colour" style="color:rgb(74, 85, 219)">(</span><span class="colour" style="color:rgb(0, 0, 0)">i</span><span class="colour" style="color:rgb(74, 85, 219)">)</span><span class="colour" style="color:rgb(74, 85, 219)">)</span><span class="colour" style="color:rgb(0, 0, 0)">;</span>
<span class="colour" style="color:rgb(0, 0, 0)">mask</span> <span class="colour" style="color:rgb(92, 92, 92)">=</span> <span class="colour" style="color:rgb(174, 92, 176)"><u>imread</u></span><span class="colour" style="color:rgb(74, 85, 219)">(</span><span class="colour" style="color:rgb(0, 0, 0)">fpath_mask</span><span class="colour" style="color:rgb(74, 85, 219)">(</span><span class="colour" style="color:rgb(0, 0, 0)">i</span><span class="colour" style="color:rgb(74, 85, 219)">)</span><span class="colour" style="color:rgb(74, 85, 219)">)</span><span class="colour" style="color:rgb(0, 0, 0)">;</span>
<span class="colour" style="color:rgb(100, 174, 100)"><i>// get a random rotation value</i></span>
<span class="colour" style="color:rgb(0, 0, 0)">rotVal</span> <span class="colour" style="color:rgb(92, 92, 92)">=</span> <span class="colour" style="color:rgb(50, 185, 185)">grand</span><span class="colour" style="color:rgb(74, 85, 219)">(</span><span class="colour" style="color:rgb(188, 143, 143)">1</span><span class="colour" style="color:rgb(0, 0, 0)">,</span> <span class="colour" style="color:rgb(188, 143, 143)">1</span><span class="colour" style="color:rgb(0, 0, 0)">,</span> <span class="colour" style="color:rgb(188, 143, 143)">"</span><span class="colour" style="color:rgb(188, 143, 143)">unf</span><span class="colour" style="color:rgb(188, 143, 143)">"</span><span class="colour" style="color:rgb(0, 0, 0)">,</span> <span class="colour" style="color:rgb(92, 92, 92)">-</span><span class="colour" style="color:rgb(188, 143, 143)">5</span><span class="colour" style="color:rgb(0, 0, 0)">,</span> <span class="colour" style="color:rgb(188, 143, 143)">5</span><span class="colour" style="color:rgb(74, 85, 219)">)</span><span class="colour" style="color:rgb(0, 0, 0)">;</span>
<span class="colour" style="color:rgb(100, 174, 100)"><i>// rotate the input image</i></span>
<span class="colour" style="color:rgb(0, 0, 0)">cropVal</span> <span class="colour" style="color:rgb(92, 92, 92)">=</span> <span class="colour" style="color:rgb(188, 143, 143)">0</span><span class="colour" style="color:rgb(0, 0, 0)">;</span>
<span class="colour" style="color:rgb(0, 0, 0)">img</span> <span class="colour" style="color:rgb(92, 92, 92)">=</span> <span class="colour" style="color:rgb(174, 92, 176)"><u>imrotate</u></span><span class="colour" style="color:rgb(74, 85, 219)">(</span><span class="colour" style="color:rgb(0, 0, 0)">img</span><span class="colour" style="color:rgb(0, 0, 0)">,</span><span class="colour" style="color:rgb(0, 0, 0)">rotVal</span><span class="colour" style="color:rgb(0, 0, 0)">,</span><span class="colour" style="color:rgb(0, 0, 0)">cropVal</span><span class="colour" style="color:rgb(74, 85, 219)">)</span><span class="colour" style="color:rgb(0, 0, 0)">;</span>
<span class="colour" style="color:rgb(174, 92, 176)"><u>imshow</u></span><span class="colour" style="color:rgb(74, 85, 219)">(</span><span class="colour" style="color:rgb(0, 0, 0)">img</span><span class="colour" style="color:rgb(74, 85, 219)">)</span><span class="colour" style="color:rgb(0, 0, 0)">;</span>
<span class="colour" style="color:rgb(100, 174, 100)"><i>// rotate the mask image</i></span>
<span class="colour" style="color:rgb(0, 0, 0)">mask</span> <span class="colour" style="color:rgb(92, 92, 92)">=</span> <span class="colour" style="color:rgb(174, 92, 176)"><u>imrotate</u></span><span class="colour" style="color:rgb(74, 85, 219)">(</span><span class="colour" style="color:rgb(0, 0, 0)">mask</span><span class="colour" style="color:rgb(0, 0, 0)">,</span><span class="colour" style="color:rgb(0, 0, 0)">rotVal</span><span class="colour" style="color:rgb(0, 0, 0)">,</span><span class="colour" style="color:rgb(0, 0, 0)">cropVal</span><span class="colour" style="color:rgb(74, 85, 219)">)</span><span class="colour" style="color:rgb(0, 0, 0)">;</span>
<span class="colour" style="color:rgb(174, 92, 176)"><u>imshow</u></span><span class="colour" style="color:rgb(74, 85, 219)">(</span><span class="colour" style="color:rgb(0, 0, 0)">mask</span><span class="colour" style="color:rgb(74, 85, 219)">)</span><span class="colour" style="color:rgb(0, 0, 0)">;</span>
<span class="colour" style="color:rgb(100, 174, 100)"><i>// add suffix : _rot</i></span>
<span class="colour" style="color:rgb(0, 0, 0)">fNameOut</span> <span class="colour" style="color:rgb(92, 92, 92)">=</span> <span class="colour" style="color:rgb(0, 0, 0)">baseNameImg</span><span class="colour" style="color:rgb(74, 85, 219)">(</span><span class="colour" style="color:rgb(0, 0, 0)">i</span><span class="colour" style="color:rgb(74, 85, 219)">)</span> <span class="colour" style="color:rgb(92, 92, 92)">+</span> <span class="colour" style="color:rgb(188, 143, 143)">"</span><span class="colour" style="color:rgb(188, 143, 143)">_rot</span><span class="colour" style="color:rgb(188, 143, 143)">"</span> <span class="colour" style="color:rgb(92, 92, 92)">+</span> <span class="colour" style="color:rgb(0, 0, 0)">extImg</span><span class="colour" style="color:rgb(74, 85, 219)">(</span><span class="colour" style="color:rgb(0, 0, 0)">i</span><span class="colour" style="color:rgb(74, 85, 219)">)</span><span class="colour" style="color:rgb(0, 0, 0)">;</span>
<span class="colour" style="color:rgb(174, 92, 176)"><u>imwrite</u></span><span class="colour" style="color:rgb(74, 85, 219)">(</span><span class="colour" style="color:rgb(0, 0, 0)">img</span><span class="colour" style="color:rgb(0, 0, 0)">,</span> <span class="colour" style="color:rgb(0, 0, 0)">subDir1</span> <span class="colour" style="color:rgb(92, 92, 92)">+</span> <span class="colour" style="color:rgb(188, 143, 143)">"</span><span class="colour" style="color:rgb(188, 143, 143)">\</span><span class="colour" style="color:rgb(188, 143, 143)">"</span> <span class="colour" style="color:rgb(92, 92, 92)">+</span> <span class="colour" style="color:rgb(0, 0, 0)">fNameOut</span><span class="colour" style="color:rgb(74, 85, 219)">)</span><span class="colour" style="color:rgb(0, 0, 0)">;</span>
<span class="colour" style="color:rgb(0, 0, 0)">fNameOut</span> <span class="colour" style="color:rgb(92, 92, 92)">=</span> <span class="colour" style="color:rgb(0, 0, 0)">baseNameMask</span><span class="colour" style="color:rgb(74, 85, 219)">(</span><span class="colour" style="color:rgb(0, 0, 0)">i</span><span class="colour" style="color:rgb(74, 85, 219)">)</span> <span class="colour" style="color:rgb(92, 92, 92)">+</span> <span class="colour" style="color:rgb(188, 143, 143)">"</span><span class="colour" style="color:rgb(188, 143, 143)">_rot</span><span class="colour" style="color:rgb(188, 143, 143)">"</span> <span class="colour" style="color:rgb(92, 92, 92)">+</span> <span class="colour" style="color:rgb(0, 0, 0)">extMask</span><span class="colour" style="color:rgb(74, 85, 219)">(</span><span class="colour" style="color:rgb(0, 0, 0)">i</span><span class="colour" style="color:rgb(74, 85, 219)">)</span><span class="colour" style="color:rgb(0, 0, 0)">;</span>
<span class="colour" style="color:rgb(174, 92, 176)"><u>imwrite</u></span><span class="colour" style="color:rgb(74, 85, 219)">(</span><span class="colour" style="color:rgb(0, 0, 0)">mask</span><span class="colour" style="color:rgb(0, 0, 0)">,</span> <span class="colour" style="color:rgb(0, 0, 0)">subDir2</span> <span class="colour" style="color:rgb(92, 92, 92)">+</span> <span class="colour" style="color:rgb(188, 143, 143)">"</span><span class="colour" style="color:rgb(188, 143, 143)">\</span><span class="colour" style="color:rgb(188, 143, 143)">"</span> <span class="colour" style="color:rgb(92, 92, 92)">+</span> <span class="colour" style="color:rgb(0, 0, 0)">fNameOut</span><span class="colour" style="color:rgb(74, 85, 219)">)</span><span class="colour" style="color:rgb(0, 0, 0)">;</span>
<span class="colour" style="color:rgb(160, 32, 240)">end</span><br></pre></div><div><br></div><div><br></div><div>Best Regards,<br></div><div>Philipp<br></div><div><br></div></div></div></div>_______________________________________________<br>users mailing list <br><a target="_blank" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a> <br><a target="_blank" href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a> <br></div></blockquote></div><div><br></div></div><br></body></html>