| 查看: 1159 | 回复: 0 | ||
[求助]
hough变换直线拟合matlab提示报错,求助~~
|
|
在网上找了个hough变换直线拟合的程序,运行后提示??? Error using ==> imshow>ParseInputs Unknown option string "fit" Error in ==> imshow at 85 [cdata, cdatamapping, clim, map, xdata, ydata, filename, ...,请问大神们该如何解决?我的版本是matlab7.0. 我的目的是对提取后的边缘进行直线拟合,目前边缘已经提取出来,在hough变换卡着了,希望大神们不吝赐教,谢谢! matlab程序(daokou.bmp即为边缘图像): clear; clc; close all; I= imread(\'daokou.bmp\'); I=rgb2gray(I); rotI = imrotate(I,33,\'crop\'); [H,T,R] = hough(I); imshow(H,[0 255],\'XData\',T,\'YData\',R,\'InitialMagnification\',\'fit\'); xlabel(\'\\theta\'), ylabel(\'\\rho\'); axis on, axis normal, hold on; P = houghpeaks(H,200,\'threshold\',ceil(0.11*max(H( )),\'NHoodSize\',[31 31]);x = T(P(:,2)); y = R(P(:,1)); plot(x,y,\'s\',\'color\',\'white\'); % Find lines and plot them lines = houghlines(BW,T,R,P,\'FillGap\',60,\'MinLength\',10); figure,imshow(BW); figure, imshow(I), hold on max_len = 0; for k = 1:length(lines) xy = [lines(k).point1; lines(k).point2]; plot(xy(:,1),xy(:,2),\'LineWidth\',2,\'Color\',\'green\'); % Plot beginnings and ends of lines plot(xy(1,1),xy(1,2),\'x\',\'LineWidth\',2,\'Color\',\'yellow\'); plot(xy(2,1),xy(2,2),\'x\',\'LineWidth\',2,\'Color\',\'red\'); % Determine the endpoints of the longest line segment len = norm(lines(k).point1 - lines(k).point2); if ( len > max_len) max_len = len; xy_long = xy; end end % highlight the longest line segment plot(xy_long(:,1),xy_long(:,2),\'LineWidth\',2,\'Color\',\'cyan\'); |
» 本帖附件资源列表
-
欢迎监督和反馈:小木虫仅提供交流平台,不对该内容负责。
本内容由用户自主发布,如果其内容涉及到知识产权问题,其责任在于用户本人,如对版权有异议,请联系邮箱:xiaomuchong@tal.com - 附件 1 : daokou.bmp
2015-08-27 09:10:33, 136.71 K
» 猜你喜欢
售SCI-T0P文章,我:8O.5.5.1.O.54,科目齐全,可+急
已经有13人回复
售SCI-T0P文章,我:8O.5.5.1.O.54,科目齐全,可+急
已经有18人回复
售SCI一区T0P文章,我:8.O.55.1.O.5.4,科目全,可+急
已经有18人回复
2027博士申请-临床检验诊断学、病原生物学、微生物方向
已经有4人回复
售SCI一区T0P文章,我:8.O.55.1.O.54,科目齐全,可+急
已经有10人回复
售SCI文章,我:8O.5.5.1O.54,科目全,可十急
已经有22人回复
越来越担心硕士毕业后没有竞争力了
已经有14人回复
论文的挂名怎么评判贡献?基金申请中,排名第一的挂名文章
已经有3人回复
申博自荐 2篇一区TOP+1篇EI+2公开发明专利 2027博士申请
已经有3人回复
闲聊
已经有6人回复











)),\'NHoodSize\',[31 31]);
回复此楼