My Question: How can I recognize borders of each stone on the photo below? Size calculation will be an easy task.
First of all I have to tell you that I’m a new kid in image recognition, and I’ll be thankful for any:
- propositions
- useful links
- book titles an chapters in it
- algorithm
- framework(especially C++)
- etc.
So..
I have an image with small stones. And I have to measure their sizes(in pixels at firs).
I’ve already played with RGB values of any pixel, and highlighted pixels witch RGB values are between constants defined by me. I don't like that some stones are glued, and some borders are wider that it should be.
for (y=0; y<height; y++,pixelIndex = width*y<<2)
for (x=0; x<width; x++,pixelIndex+=4)
if (pixelsData[pixelIndex ]>self.minRedSlider.integerValue && pixelsData[pixelIndex ]<self.maxRedSlider.integerValue &&
pixelsData[pixelIndex+1]>self.minGreenSlider.integerValue && pixelsData[pixelIndex+1]<self.maxGreenSlider.integerValue &&
pixelsData[pixelIndex+2]>self.minBlueSlider.integerValue && pixelsData[pixelIndex+2]<self.maxBlueSlider.integerValue) {
resultData[pixelIndex] = 255;
resultData[pixelIndex+1] = 255;
resultData[pixelIndex+2] = 255;
} else {
resultData[pixelIndex] = 0;
resultData[pixelIndex+1] = 0;
resultData[pixelIndex+2] = 0;
}
This is how my test app looks like at the moment:
PS: I know that my question is very vague, But I have to start and can't find or guess an appropriate direction. Any way, thanks for time you've already spent on it.