ROIROTATE was designed to avoid the 'black corners' typical of MATLAB's imrotate function, which are apearing from its behaviour of padding by zeros of the space outside the image borders prior to the rotation. This is possible if the image to be rotated is part of a bigger image, because there is enough information to fill the corners.
great job tnx
thanks a lot
Bug removed. Thanks Mathew!
Great, but there is one small but important bug! When calculating the padding, it doesn't convert from degrees to radians, which means that occasionally it will not pad the images enough. Just make sure you edit the padX and padY variables and it will work beautifully!
Published as Matlab toolbox (.mltbx file).
Degrees are now converted to radians before image processing.