Code covered by the BSD License  

Highlights from
Image Rotation Correction

image thumbnail
from Image Rotation Correction by Amir Omidvarnia
A simple function for correcting the rotated images.

example.m
clear all
clc
close all

[inputfilename,dirname] = uigetfile('*.*');
inputfilename = [dirname, inputfilename];
im = imread(inputfilename); % For example: 'input.jpg'

im2 = RotationCorrection(im);
imshow(im)
figure, imshow(im2)

Contact us at files@mathworks.com