Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

>> REGISTER NOW TO START POSTING

Thread: Finding the edges of object in photo

1. Finding the edges of object in photo

Hi all!

I'm searching photos for a white ball. Once I find something white, I want to search inside that pixel blob to see if it is round enough to be the ball I'm looking for. I know that its diameter must be between 10 and 100 pixels.

What would be a good way to follow the edge between white and non-white pixels? And checking that the object is solid white?

Consider it in monochrome, a pitch black image with perfectly white shapes in it. What would an efficient algorithm look like which finds all of the edge pixels of the shapes? I can solve this ad hoc with nested for loops, but its not pretty and I'm sure there's an optimal solution out there somewhere. (Once I have a list of the coordinates of the edge pixels, I can mathematically fit a circle to the data and find out if it could be a ball or not, no problem there).

Regards

2. Re: Finding the edges of object in photo

check for dramatic change in hue and/or saturation