How do I detect a line in a picture and extract the EndPoints?
4 views (last 30 days)
Show older comments
So basically I have the original image:

And I want to turn it into this:

The idea is to run an algorithm that detects the text in the license plate but for that the image cannot be in perspective.
I already have this:
imgcell=im2double(imread('plate.png')); %read image
img=imresize(imgcell, [100, 600]); %resize the image
imggray = rgb2gray(img); % image to gray scale
imshow(imggray);
[r,c]=size(imggray);
fixedPoints=[1,1;1,r;c,1;c,r]; %final corners of the rectangle
movingPoints=[1,8;1,74;600,18;600,92]; % original corners. problem-> has to be automatic
tform = fitgeotrans(movingPoints,fixedPoints,'projective');
img_registered = imwarp(imggray,tform,'OutputView',imref2d(size(imggray)));
figure
imshow(img_registered);
0 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!