From: jugo on
hello and good day,

i'd appreciate if i could get any hint on this.

i'm working on car plate detection project.

in the post processing part, i need to draw the boxes on the candidate
text region regardless of what shape it is for the purpose of counting
the detection rate (false positive,false negative,true positive).
problem is,it generates too many boxes.

i'd be happy if someone would shed some light on how to :
1.eliminate those small noise blob so later on it would only generate
box on only some significant blob.
(fyi,i tried imfill and bwareaopen.)

2.if there are small boxes overlapping,it would only generate one
bigger box,hence easier for calculation part.
(note on the small boxes drawn on the car plate region)

here is the code :

%% clear all
clear all;close all; clc;

%%

I = imread('test6.jpg');
row = size(I,1);
col = size(I,2);


%% binary image
level = graythresh(double(I));
I1 = im2bw(I,level);

%% get rid of noise blobs
% Do a "hole fill" to get rid of any background pixels inside the
blobs.
binaryImage = imfill(I1, 'holes');
% Get rid of blobs less than 500 pixels in area.
binaryImage = bwareaopen(I1, 1000);

%% regionprops
[Ilabel num] = bwlabel(I1);
Iprops = regionprops(Ilabel);
Ibox = [Iprops.BoundingBox];
Ibox = reshape(Ibox,[4, num]);%rearrange matrix representation
imshow(I1)
hold on;
for cnt = 1:num
rectangle('position',Ibox(:,cnt),'edgecolor','b','LineWidth', 3);
end

and here is the image :
image 1: before post processing
http://img262.imageshack.us/img262/3641/test6e.jpg

image 2: after post processing
http://img502.imageshack.us/img502/3695/oneq.jpg

thanks in advance.

regards,
-jugo