Detecting bright spots and locating the center of the bright spot

Hello Everyone

Good Day!

i am now kind of stuck on how to proceed as my aim for my project is to achieve the locating of the bright spots from different altitude which is as displayed in image5.png, image6.png and image7.png and also to detect the center of the bright spot but as i am relatively new to programming, i am unsure on how i can amend the script and would to seek your kind assistance in this. I had manage to make the detect_bright_spot script works. However may i check with you as i am relatively new to programming, i am unsure on which line of code to manipulate for the detect_bright_spots portion as i am receiving this value error currently as shown in figure 1 whenever i run the detect_bright_spots.py script for image6.png and image7.png as attached. image.png Figure1:ValueError for image6.png and image.7png

Furthermore when i tried to run a locate the center of bright spot code(center.py) as attached to locate the center of the beacon (image5.png and image7.png) there's 2 red dots on the image as shown below ￼￼ image.png Image5: After running the code to locate the center of the bright spots image.png Image7: After running the code to locate the center of the bright spots

I found the code for the detecting bright spot(https://www.pyimagesearch.com/20... and locating the center of bright spot (https://stackoverflow.com/questions/3...)

edit retag close merge delete

Sort by » oldest newest most voted
Several steps
- convert the image to grayscale
- threshold this mono image using some application specific threshold value
- find contours in the threshold image with findContours
https://docs.opencv.org/2.4/modules/imgproc/doc/structural_analysis_and_shape_descriptors.html#findcontours
- to get the center, either get the contour bounding box and use its center or loop through all the pixels in the contour and compute their average x, y value

more