How to define a general affine2D transformation matrix for all handwritten images and rotate them as needed.?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I used the following code to generate img2 from img1 but when I run the code on another image, I have to change the affine2d matrix according to each image manually... I want a code that is general for all images so that if they have slant angle more than 0 then the resulting image should have the slant angle 0. I used imwarp function for this purpose...
[filename,pathname] = uigetfile({'*.jpg;*.jpeg;*.png;*.bmp'},'File Selector');
name = strcat(pathname,filename);
img = imread(name);
img = imcomplement(img);
img = rgb2gray(img);
figure()
imshow(img);
tform = affine2d([1 0 0; 1 1 0; 0 0 1]);
J = imwarp(img,tform);
figure
imshow(J)
Can anyone help with the code?... Thanks in advance!
3 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Geometric Transformation and Image Registration finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!