基于Matlab车辆特征提取(小波轮廓检测和Moracev焦点检测)

在这里插入图片描述

%extracting objects提取目标
im=imread('17.bmp');
I=rgb2gray(im);
im1=medfilt2(I,[2 2]); %Median filtering the image to remove noise%
BW=edge(im1,'sobel'); %finding edges 
[imx,imy]=size(BW);
msk=[
      1 1 1 ;
      1 1 1 ;
      1 1 1 ;
    ];
B=conv2(double(BW),double(msk)); %Smoothing  image to reduce the number of connected components
L = bwlabel(B,8);% Calculating connected components
mx=max(max(L))
% There will be mx connected components.Here U can give a value between 1 and mx for L or in a loop you can extract all connected components
% If you are using the attached car image, by giving 17,18,19,22,27,28 to L you can extract the number plate completely.
[r,c] = find(L==17);  
rc = [r c];
[sx sy]=size(rc);
n1=zeros(imx,imy); 
for i=2:sx
    x1=rc(i,1);
    y1=rc(i,2);
    n1(x1,y1)=255;
end % Storing the extracted image in an array
figure,imshow(im);
figure,imshow(im1);
figure,imshow(BW);
I2=BW;
originalmap=I2;
%calculate every pixel's IV(Interest value)
%divide image I by w*w
w=5;%divide to m*n
m=floor(size(I2,1)/w); %rows,round
n=floor(size(I2,2)/w); %columns
%get the coordinate of every centroid
c=ceil(w/2)+(0:n-1)*w; %x coordinate
r=ceil(w/2)+(0:m-1)*w; %y coordinate
%calculate every pixel's IV
step=floor(w/2);

完整代码链接:https://pan.baidu.com/s/1R1HRoEJoplHZS1_63W34Rw

提取码:nhxh

  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值