Identifying bright spots in RGB image
Show older comments
I have hundreds of RGB images (one of the image is attached). For reference these are interference images and the RGB color values correspond to certain film thickness between a semi reflective glass surface and a steel surface. I apply electric potential across the surface and observed electric discharges which show as bright spots on the image (highlighted in red circle in attached image).
I want to write a script in MATLAB (2023a) that goes through the images, identify these bright spots stores there location in the XY cordinate system. The end goal is to show spatial distribution of the electric discharges.
3 Comments
Walter Roberson
on 15 Apr 2026 at 17:47
Question: Is there always exactly zero or one bright spots to be detected, or do some images have multiple bright spots?
dpb
on 15 Apr 2026 at 18:44
Second Q: Are these spots guranteed to be in the general background color area of the example? The difficulty in discerning differences is going to be very tough or completely impossible in some areas of the image.
I'd guess adding a few more "typical" images might be beneficial.
Ammad Yousuf
on 15 Apr 2026 at 19:40
Answers (1)
Image Analyst
on 15 Apr 2026 at 19:13
1 vote
If the spots are always about the same size and white, then you can just segment out white regions and then filter out things that are not small and round.
Convert to HSI color space
- Threshold the S channel to find bright, neutral colored regions.
- Call bwareafilt() to extract out things in the desired size range.
- Call regionprops to get the Centroid and Bounding Box or roundness.
- Compute aspect ratio and get rid of things that are not round.
Let me know if you need help figuring it out. Attach more images also.
5 Comments
Ammad Yousuf
on 15 Apr 2026 at 19:41
Image Analyst
on 15 Apr 2026 at 21:40
It depends on if the white spots are all about the same intensity. If they are you can do it in RGB space just thresholding each color channel independently and ANDing the binary images together. If they have varying brightnesses, then convert to HSI space because that will let you find all neutral colored regions regardless of what intensity they are.
Ammad Yousuf
about 23 hours ago
Edited: Ammad Yousuf
about 23 hours ago
dpb
about 22 hours ago
Those are the sort of thing I was envisioning that are going to be extremely difficult to pick out, I suspect. I doubt edge detection is going to be of much help there, there really isn't any edge to detect.
It's probably too late, but I'd think taking the images through a filter initially might have helped....or a thermal instead of visual image, maybe?
I suggest you try a tophat filter. It's meant for this kind of object. Get SE with strel using a disc of radius 1, 2, or 3 or whatever is best.
help imtophat
Categories
Find more on Image Processing Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!