Using Edge Projection Profile information to filter out irrelevant bounding boxes
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/156413/image.png)
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
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/156414/image.png)
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?
Respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!