资源简介
使用matlab编写图校校正程序,该对倾斜图像的校正有很好的效果。。。
代码片段和文件信息
clear;
clc;
I = imread(‘C:\Program Files\MATLAB71\toolbox\images\imdemos\gg.jpg‘);
I=rgb2gray(I);
BW = edge(I‘canny‘);
[HTR] = hough(BW);
imshow(H[]‘XData‘T‘YData‘R...
‘InitialMagnification‘‘fit‘);
xlabel(‘\theta‘) ylabel(‘\rho‘);
axis on axis normal hold on;
P = houghpeaks(H5‘threshold‘ceil(0.3*max(H(:))));
x = T(P(:2)); y = R(P(:1));
plot(xy‘s‘‘color‘‘white‘);
% Find lines and plot them
lines = houghlines(BWTRP‘FillGap‘5‘MinLength‘7);
figure imshow(I) hold on
max_len = 0;
longest_line_index=0;
for k = 1:length(lines)
xy = [lines(k).po
- 上一篇:bp神经网络的车牌识别M文件
- 下一篇:算法标准测试函数
评论
共有 条评论