Take the 2-minute tour ×
Signal Processing Stack Exchange is a question and answer site for practitioners of the art and science of signal, image and video processing. It's 100% free, no registration required.

I have an input as a 3D binary image and the preferred output below:

Input:

INPUT

Preferred Output:

OUTPUT

What image processing methods should I look for if I am to have only the spiky object(s) remain, just like the preferred output above?

share|improve this question
    
What do you mean by 3D binary image? Can you easily segment the image into individual parts? –  bjoernz Mar 3 '12 at 7:11
    
By 3D, I mean It's a tomographical image. –  Karl Mar 3 '12 at 7:27
1  
Can you explain what is spiky object? What really calls it spiky? what are the key characteristics to spot spiky objects? –  Dipan Mehta Mar 3 '12 at 7:53
    
A spiky object in this case is a 3D area that is not smooth and has these thorn like shapes all over them. –  Karl Mar 3 '12 at 10:18
add comment

1 Answer 1

up vote 19 down vote accepted

There are more corners on the borders of your "spiky object", so one approach would be to tune a corner detector for this.

For example, I calculated the determinant of the structure tensor (Mathematica code below) of a distance-transformed image:

enter image description here

Binarizing with hysteresis yields this image, which should be a good starting point for the segmentation algorithm of your choice:

enter image description here

Mathematica code (src is the source image you posted)

At first, i calculate a distance transform of the input image. This creates contrasts over the whole object area (instead of just the border), so the whole object can be detected.

dist = ImageData[DistanceTransform[src]];

Next I prepare the components of the structure tensor. The filter size for the gaussian derivatives if 5, the window size is 20.

gx = GaussianFilter[dist, 5, {1, 0}];
gy = GaussianFilter[dist, 5, {0, 1}];
gx2 = GaussianFilter[gx^2, 20];
gxy = GaussianFilter[gx*gy, 20];
gy2 = GaussianFilter[gy^2, 20];   

To calculate the corner filter at each pixel, I simply plug these into the symbolic determinant of the structure tensor:

corners = Det[{{dx2, dxy}, {dxy, dy2}}] /. {dx2 -> gx2, dxy -> gxy, dy2 -> gy2};

Which is basically the same as:

corners = gx2 * gy2 - gxy * gxy;

Converting this to an image and scaling it to 0..1 range yields the corner detector image above.

Finally, binarizing it with the right thresholds gives the final, binary image:

MorphologicalBinarize[Image[corners], {0.025, 0.1}]
share|improve this answer
    
Very cool answer! = ) –  Phonon Mar 4 '12 at 1:54
    
Your answers are amazing, I learn a lot from them. –  Andrey Oct 11 '12 at 11:40
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.