MATLAB: Image Processing: Detect Quartz Veins in Photos

image processing

Hi,
I was hoping to get some help. I'm trying to automate a procedure to detect quartz veins in core photos from a mining database. I've converted the images to binary using a variety of gray theshold values. The problem is that it detects too much of the wooden box, tags etc.
If I manually crop out just the rock, the results are much better. This is unrealistic through because I need a way to batch process.
Here is the original photo and a binary version. As you can see, too much of the box is selected and a bunch of other stuff. I need to select only the white quartz veins that cut through the gray rock.
I'm quite new to image processing so I apologize if this is a fairly simple problem.
Thanks for your help!

Best Answer

It's not a simple problem. On the face of it, it might look simple but I can foresee all kinds of possible problems. What I would start off with is doing color segmentation - basically find the brown pixels. See my File Exchange for examples. http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862
But there might be cases where the "white" marble is very close in color to the light brown wood. Have you looked at the 3D color inspector to see the full 3D color gamut? As you can see below, there is quite a bit of overlap/blending between the colors. It's not like you have 3 very well separated colors.
Related Question