question about imrotate function
Ältere Kommentare anzeigen
When I use imrotate function to rotate a binary image which only has a single pixel with value of one, the rotate function I use as follow:
fimage = zeros(480,640);
fimage(140,396) = 1;
if 5.2668 < 90
fimage = imrotate(fimage, 5.2668,'crop');
elseif 5.2668 > 90
fimage = imrotate(fimage, 5.2668, 'crop');
end
where fimage is the image with size of 480*640 and with all value zero expect that single pixel, and the single value one pixel with the position of [140 396], however, the after rotating , I can not find that single value any more, which means the whole image becomes zero value. It seems that the rotate angle is not too large to make that value one pixel out of boundary, also that pixel almost lies in the center of the image, so it mean it should not be out of boundary and corp by that function. Can anyone help me on this?*
Thanks so much ahead.
2 Kommentare
UTA
am 29 Nov. 2013
Image Analyst
am 29 Nov. 2013
Like I tried to explain to you below, it depends on how close the input pixel is to its rotated position. If it's close, and the value would be more than 0.5 it rounds it up and you'll see it.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Image Processing and Computer Vision finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!