Identifying bright spots in RGB image

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

Question: Is there always exactly zero or one bright spots to be detected, or do some images have multiple bright spots?
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.
Thank you for your response.
  1. There can be multiple spots of approximately same intensity.
  2. The backgorund color would change as the film thickness changes. But based on the physics behind, they have higher probability of occuring in the two lobe regions.
I am adding more images showing these spots.

Sign in to comment.

Answers (1)

Image Analyst
Image Analyst on 15 Apr 2026 at 19:13
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
  1. Threshold the S channel to find bright, neutral colored regions.
  2. Call bwareafilt() to extract out things in the desired size range.
  3. Call regionprops to get the Centroid and Bounding Box or roundness.
  4. 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

Thank you for your kind response. The spots are of approximately same size and white. Can I use RGB data or should I convert to HSI color space?
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
Ammad Yousuf about 23 hours ago
Edited: Ammad Yousuf about 23 hours ago
I tried it with RGB image and in HSI color sapce but could not get the desired result. Because these spots are very subtle and the background color can change I am really stuck with this.
Is it possible to convert the RGB image to grayscale and use edge detection, but I don't have much experience or knowledge with this. I have attached some images and one in grayscale. With this I dont need to determine the circularity or aspect ratio.
Thank you for your help.
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
imtophat - Top-hat filtering This MATLAB function performs morphological top-hat filtering on the grayscale or binary image I using the structuring element SE. Syntax J = imtophat(I,SE) J = imtophat(I,nhood) Input Arguments I - Input image grayscale image | binary image SE - Structuring element strel object | offsetstrel object nhood - Structuring element neighborhood matrix of 0s and 1s Output Arguments J - Top-hat filtered image grayscale image | binary image Examples openExample('images/UseTophatFilteringToCorrectUnevenIlluminationExample') See also imclose, imdilate, imerode, imopen, imbothat Introduced in Image Processing Toolbox before R2006a Documentation for imtophat doc imtophat Other uses of imtophat gpuArray/imtophat

Sign in to comment.

Categories

Products

Release

R2023a

Asked:

on 15 Apr 2026 at 17:13

Commented:

on 18 Apr 2026 at 0:29

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!