[Scilab-users] imrotate

classic Classic list List threaded Threaded
2 messages Options
der_Phil der_Phil
Reply | Threaded
Open this post in threaded view
|

[Scilab-users] imrotate

Dear Experts,

using imrotate() from IPCV-toolbox:

imout = imrotate(im1,deg,crp)
crp : Returns only central portion output image which is the same size as source if set to 1

My input image is 512x512 pixel.

The output image shall be of the same size.

For this I try crop = 1 and also crop = 0

However the output image is always of different size, depending on the rotation value.

Do I misunderstand something?

Here my code:

for i = 1:nrOrigImg
    
    img = imread(fpath_img(i));
    mask = imread(fpath_mask(i));
    
    // get a random rotation value
    rotVal = grand(1, 1, "unf", -5, 5);
    
    // rotate the input image
    cropVal = 0;
    
    img = imrotate(img,rotVal,cropVal);
    imshow(img);
    
    // rotate the mask image
    mask = imrotate(mask,rotVal,cropVal);
    imshow(mask);
    
    // add suffix : _rot
    fNameOut = baseNameImg(i) + "_rot" + extImg(i);
    imwrite(img, subDir1 + "\" + fNameOut);
    
    fNameOut = baseNameMask(i) + "_rot" + extMask(i);
    imwrite(mask, subDir2 + "\" + fNameOut);
    
end


Best Regards,
Philipp


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Tan Chin Luh Tan Chin Luh
Reply | Threaded
Open this post in threaded view
|

Re: imrotate

Hi,

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. 

please make a report here : https://github.com/tanchinluh/IPCV so that we could put it into our future release. 

Thanks.

Regards,
Chin Luh


---- On Wed, 24 Jun 2020 16:22:39 +0800 P M <[hidden email]> wrote ----

Dear Experts,

using imrotate() from IPCV-toolbox:

imout = imrotate(im1,deg,crp)

crp : Returns only central portion output image which is the same size as source if set to 1

My input image is 512x512 pixel.

The output image shall be of the same size.

For this I try crop = 1 and also crop = 0

However the output image is always of different size, depending on the rotation value.

Do I misunderstand something?

Here my code:

for i = 1:nrOrigImg
    
    img = imread(fpath_img(i));
    mask = imread(fpath_mask(i));
    
    // get a random rotation value
    rotVal = grand(1, 1, "unf", -5, 5);
    
    // rotate the input image
    cropVal = 0;
    
    img = imrotate(img,rotVal,cropVal);
    imshow(img);
    
    // rotate the mask image
    mask = imrotate(mask,rotVal,cropVal);
    imshow(mask);
    
    // add suffix : _rot
    fNameOut = baseNameImg(i) + "_rot" + extImg(i);
    imwrite(img, subDir1 + "\" + fNameOut);
    
    fNameOut = baseNameMask(i) + "_rot" + extMask(i);
    imwrite(mask, subDir2 + "\" + fNameOut);
    
end


Best Regards,
Philipp

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users



_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users