File Exchange

image thumbnail

Fast imrotate

version (5.24 KB) by Ilan Ben Hagai
A fast version of imrotate


Updated 28 Nov 2007

No License

This mex file will rotate UINT8 images just like imrotate(image,angle,'crop'), but ten times faster.

Comments and Ratings (11)


I tried to compile the C code on 32-bit Windows with the LCC compiler that comes with R2011b. I got "illegal statement termination" and "undeclared identifier" errors on several lines of the code.

C:\MATLAB\R2011B\BIN\MEX.PL: Error: Compile of 'fast_rotate.cpp' failed.

Any suggestions?

thank you for sharing the code!
i got (almost) the same results but the matlab built-in function is a bit faster.
(0.282 compared to 0.351 secs)
Any way, thank you for letting me know the 'crop' option in the matlab function because it's really boost the performance since i use the function >1700 times in my code!

thanks a lot.


How can I compile the cpp-file?
Please give me a quick info.

Many thanks in advance!

sethb Benton

Fantastic code

Amazing! Speeded up my optimization drastically... thank you!


Works great!! Indeed, a non-cropping version would be useful.

Daniel Armyr

You might want to considder making your demo self-contained, that is you include the circuit.tif into the zip file.

Gio Kordie

Man! You rule!It was exactly what i needed!
Now i will boost the performance of my code.!

Dennis Olly

Indeed very fast and results identical to matlabs imrotate(...'crop').
A non-cropping version would be very helpful!

MATLAB Release Compatibility
Created with R14
Compatible with any release
Platform Compatibility
Windows macOS Linux