在八度中获取未定义的“ bwconncomp”

时间:2019-05-11 09:57:22

标签: matlab octave

我正在尝试在八度上运行车牌检测程序。当我尝试运行程序时,出现以下警告和错误。

  

八度:1> pkg加载图像   警告:函数/home/user/octave/image-2.10.0/rgb2gray.m隐藏了核心库函数   警告:来自       第48行第5列的load_packages_and_dependencies       第47行第3列的load_packages       pkg在第457行的第7列

  

octave:2> run(“ / home / ReadNumberPlate / Plate_detection.m”)   'bwconncomp'在第249行第10列附近未定义   错误:来自       第249行第8列的regionprops       第10行第7列的Plate_detection       在第71行的第7列

这是Plate_detection.m内的代码

close all;
clear all;

im = imread('Images/1.jpeg');
imgray = rgb2gray(im);
imbin = im2bw(imgray);
im = edge(imgray, 'prewitt');

%Below steps are to find location of number plate
Iprops=regionprops(im,'BoundingBox','Area', 'Image');
area = Iprops.Area;
count = numel(Iprops);
maxa= area;
boundingBox = Iprops.BoundingBox;
for i=1:count
   if maxa<Iprops(i).Area
       maxa=Iprops(i).Area;
       boundingBox=Iprops(i).BoundingBox;
   end
end    

im = imcrop(imbin, boundingBox);%crop the number plate area
im = bwareaopen(~im, 500); %remove some object if it width is too long or too small than 500

 [h, w] = size(im);%get width

imshow(im);

Iprops=regionprops(im,'BoundingBox','Area', 'Image'); %read letter
count = numel(Iprops);
noPlate=[]; % Initializing the variable of number plate string.

for i=1:count
   ow = length(Iprops(i).Image(1,:));
   oh = length(Iprops(i).Image(:,1));
   if ow<(h/2) & oh>(h/3)
       letter=Letter_detection(Iprops(i).Image); % Reading the letter corresponding the binary image 'N'.
       noPlate=[noPlate letter] % Appending every subsequent character in noPlate variable.
   end
end

谁能告诉我这样做的原因以及可能的解决方法。

0 个答案:

没有答案