完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
`下面是我的代码 。。。只画出线 并不能检测矩形 ,求大神指教啊 另外,我附上需检测的图片a=imread('juxing.bmp');
a=rgb2gray(a) I=dither(a) roti=imrotate(I,33,'crop') BW=edge(rotI,'log'); [H,T,R]=hough(BW); P=houghpeaks(H,18,'threshold',ceil(0.3*max(H(:)))); x=T(P(:,2));y=R(P(:,1)); lines=houghlines(BW,T,R,P,'FillGap',18,'MinLength',8); figure,imshow(rotI),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(xy(1,1),xy(1,2),'x','LineWidth',2,'Color','yellow'); plot(xy(2,1),xy(2,2),'x','LineWidth',2,'Color','red'); end ` |
|
相关推荐
1个回答
|
|
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-3-29 01:05 , Processed in 0.439078 second(s), Total 70, Slave 53 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 深圳华秋电子有限公司
电子发烧友 (电路图) 粤公网安备 44030402000349 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号