[Scilab-users] imrotate

P M p.muehlmann at gmail.com
Wed Jun 24 10:22:39 CEST 2020


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20200624/7cc6af80/attachment.htm>


More information about the users mailing list