2

The spatial resolution images that i will be using in this project is 1000x563. My aim in this step is to remove all unwanted white pixel but not the number plate so I could segment the plate accurately. But the problem is I could not remove those unwanted pixels clearly. Can anybody help me to improve the codes?

From: enter image description here Then, enter image description here Then, enter image description here Lastly, enter image description here

As you observed the last image, there are still quite a number of unwanted white pixels. Please help !!

ab=imread('image4.jpg'); ab=rgb2gray(ab); level=graythresh(ab); ab=im2bw(ab,level); ab=medfilt2(ab,[3 3]); ab=edge(ab,'Canny'); figure(); imshow(ab); Tmp = imfill(ab, 'holes'); %flood filling techniques Tmp2 = imfill(Tmp-ab, 'holes'); Res = Tmp - imfill(ab & Tmp2, 'holes'); figure(); imshow(Res,[]); % keeping the white pixels area between 200 to 1000 LB = 200; UB = 1000; Res = xor(bwareaopen(Res,LB), bwareaopen(Res,UB)); figure, imshow(Res,[]); se = strel('disk',2); Res = imerode(Res,se); Res=imdilate(Res,se); Res = bwareaopen(Res, 200); figure(); imshow(Res,[]); 

2 Answers 2

4

You might want to consider using Stroke Width Transform. A Matlab implementation can be found here. This transform is used to detect text in natural images. It is designed to work in a much more challenging settings than yours. So, I guess you should give it a try.

Sign up to request clarification or add additional context in comments.

1 Comment

you wrote down an algorithm in stackoverflow.com/questions/19960826/… can you briefly tell me how to apply the function, for instance, parameter "dol".. swt and swtcc. Much appreciated, sir.
0

Is the number plate in your pictures always the same size (at least approximately)?
If so you could look at some fix-sized patch of pixels, maybe with some overlap to others, and if the number of white pixels is above some threshold leave them and otherwise paint them black.
Or just mark them and if the surrounding patches are also to be cleaned, paint them black.

1 Comment

Yes, it is approximately the same size. Can you emphasize further of your explanation..?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.