Reputation: 377
In my project i have a set of led's in a board with same pattern.While seeing that led's using a camera,found white holes in an image.(first attachment)
(1). My first requirement is i need to find No of working and not working led's.This one is much easier when i used blob detection using opencv. i found successfully.
(2). My second requirement is i need to draw working led's in green color and not working led's in red color.i was struggled here.
if all the led's are working properly i got the center of all the blobs easily and using that center points i was drawn in green color.But the problem is if any one led's are not working.i did not get any white hole in an image.I did not get any blobs in the image.How can i draw a not working led in red color.
please find the attachment below which is useful to understand my problem.Thanks in advance
Input Image
if all the led's are working i drawn like this
One led Was not working.Now i need to identify that not working led and i will draw it in a red color like my fourth attachment.
Upvotes: 1
Views: 1267
Reputation: 18675
As Francesco wrote in his answer, if these assumptions are valid:
then, as suggested by Rethunk, you can try a simple algorithm like this one:
c_i
r_i
c_i
compute the histogram of the pixels contained in a circle centered at c_i
and with radius equal to a_i*r_i
(where 0 < a_i <= 1
). If a percentage p_i
of the number of pixels considered in the histogram have the grey level greater than a threshold t_i
then draw a green disk centered at c_i
with radius a_i*r_i
, else, draw a red disk.Find with some experiments the right values for a_i
, p_i
, t_i
.
Upvotes: 0
Reputation: 11825
If the LED arrangement and scale is constant (which probably should be, if this is a manufactured part), can't you just register to the test image a "reference" one with all the LEDs working, and then find blob-sized-and-shaped mismatches, which would be indicative of a malfunctioning device?
Upvotes: 3