Ask Your Question
0

Detecting bright spots and locating the center of the bright spot

asked 2019-02-21 11:44:13 -0600

jhlolol2 gravatar image

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...)

Thanks in advanceC:\fakepath\image7.png(/upfiles/15507708388950245.png)(/upfiles/15507708277477081.png) Regards Junhui

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
0

answered 2019-02-21 16:18:58 -0600

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
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2019-02-21 11:44:13 -0600

Seen: 3,935 times

Last updated: Feb 21 '19