Using Edge Projection Profile information to filter out irrelevant bounding boxes
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
url='https://i.ytimg.com/vi/cEmSo_7wnfs/hqdefault.jpg';
Image=imread(url);
grayImage=rgb2gray(Image);
%imshow(grayImage);
edgedImage=edge(grayImage,'sobel','vertical');
%figure;imshow(edgedImage);
%signal=sum(edgedImage,2);
%figure;plot(signal);
seDilated=strel('rectangle',[3,20]);
dilatedImage=imdilate(edgedImage,seDilated);
%figure;imshow(dilatedImage);
seOpened=strel('rectangle',[1,10]);
openedImage=imopen(dilatedImage,seOpened);
%figure;imshow(openedImage);
connComp=bwconncomp(openedImage,4);
regions=regionprops(connComp,'BoundingBox');
imshow(Image);
hold on;
for i=1:length(regions)
box=regions(i).BoundingBox;
rectangle('Position',box,'EdgeColor','y','LineWidth',4);
end
My result is following
I am getting a lot of false positive bounding boxes So I want to used horizontal Projection Profile Information into my code to filter out those bounding boxes
The command
plot(sum(edgedImage,2))
produces following plot
Those high peaks areas correspond to text location in the image.My question is how can I use this information in my code to filter out irrelavant bounding boxes?
1 Kommentar
Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!