Ask Your Question

Calculate the location of object on solid background..

asked 2014-06-17 15:38:47 -0500

Teck gravatar image

If I have an image like this:

What would be the best way to calculate the location of the dot on the image? Currently I'm learning to do this with solid images, but plan to end up doing this with a web cam. Essentially I'm using image subtraction because my background will never change.

Any tips would be appreciated.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-06-17 17:39:31 -0500

unxnut gravatar image

You should be able to find the location of dot using minMaxLoc. Look for the max location point for the white dot. As long as you have a single dot, this should give you the correct answer.

edit flag offensive delete link more


Will that still work if there are small variations in background noise or the size of the dot, or the color of the dot?... Because the dot is not a solid white..

Teck gravatar imageTeck ( 2014-06-17 18:32:12 -0500 )edit

You should be able to process the image to remove the background noise. And yes, it will work as long as the dot is brighter than the background.

unxnut gravatar imageunxnut ( 2014-06-17 18:38:41 -0500 )edit

Question Tools


Asked: 2014-06-17 15:38:47 -0500

Seen: 206 times

Last updated: Jun 17 '14