필터 지우기
필터 지우기

How to define a general affine2D transformation matrix for all handwritten images and rotate them as needed.?

조회 수: 1 (최근 30일)
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
HJ Akhtar
HJ Akhtar 2018년 7월 19일
I didn't... I just randomly assigned the value to matrix I don't know how to compute it.. and if got, how to define affine2d matrix on the basis of that angle
HJ Akhtar
HJ Akhtar 2018년 7월 20일
Can you please tell me how to do it? Code example will be appreciated.. Thankyou

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Processing and Computer Vision에 대해 자세히 알아보기

제품


릴리스

R2012b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by