最小外接矩形最小外接矩形
rectangle('Position',[0.59,0.35,3.75,1.37],'Curvature',[0,0],'LineWidth',2,'LineStyle','--')
rectangle('Position',[x×ø?ê,y×ø?ê,?í,?ß],'Curvature',[ÇúÂÊ×ÝÏò,ÇúÂʺáÏò],'LineWidth',Ïß?í,'LineStyle','ÏßÐÎ')
ÓÃmatlab?,×îÐ?Íâ?Ó?ØÐÎ
Àý×Ó?ºÖ?Òª?Ø×?º?Êýregionprops...
最小外接矩形
rectangle('Position',[0.59,0.35,3.75,1.37],'Curvature',[0,0],'LineWidth',2,'LineStyle','--')
rectangle('Position',[x×ø?ê,y×ø?ê,?í,?ß],'Curvature',[ÇúÂÊ×ÝÏò,ÇúÂʺáÏò],'LineWidth',Ïß?í,'LineStyle','ÏßÐÎ')
ÓÃmatlab?,×îÐ?Íâ?Ó?ØÐÎ
Àý×Ó?ºÖ?Òª?Ø×?º?Êýregionprops
======================================
function location=liences_plate_location(image_originate) %Author: Zeng Feng
%Date: 11.24.2005
%In: image_originate -- the original image containing the % information about the location of veichile
% lience plate
%Out: location -- containing the up-left corner location % information and the rectangle width and
% height information
image_double=double(image_originate); %change the data type to benefit the following procedure
image_RGBsum=sum(image_double,3); %compute the sum of R,G,B value with respect to the pixel
image_bi=image_double(:,:,3).\image_RGBsum; %compute the ration of sum of (RG to the B component
image_bi=uint8(image_bi)*100; %change the data type threshold=graythresh(image_bi); %compute the threshold value for binarilization
image_bi_bin=im2bw(image_bi,threshold);
image_bi_bin=uint8(image_bi_bin);
image_bi_bin=1-image_bi_bin;
image_bi_bin=logical(image_bi_bin);
se=strel('line', 10, 0); % dilation
image_bi_di=imdilate(image_bi_bin,se);
******************************************************* * Çë×?Òâ×ÅÏÂÃæµÄ?úÂë??Óõ?ÁËregionprops
******************************************************* Label=bwlabel(image_bi_di); % connected component labeling area_num=regionprops(Label,'Area'); % following compute binary region properties
len_area=length(area_num);
max_ind=0;
max_num=0;
area_bounding=regionprops(Label,'BoundingBox'); t=[];
j=0;
for i=1:len_area %compute the ratio of region width to height
%search ones witch meet the quality
ration=area_bounding(i).BoundingBox(4)/area_bounding(i).BoundingBo
x(3);
if ration>0.25 && ration<0.75
j=j+1;
t(j)=i;
end
end
len_j=length(t);
max_ind=t(1);
max_num=area_num(t(1)).Area;
for i=1:len_j %select the one with the maximum size within the candidate
if max_num
本文档为【最小外接矩形】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑,
图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。