Can anyone tell me how to extract and crop the roi based on its gray level profile?

I have taken up following steps after detection of a refernce axis using hough lines.. detected the profile (using improfile function) stored the x, y coordinates in arrays vth corresponding value of intensity profile for each co-ordinate pair using a for loop.
now i want to extract the regions having regional maxima-minima-maxima in gray level profile. then i want to crop the extracted roi. I am a new to image processing so kindly guide step by step.

Answers (1)

Try imregionalmax() and imregionalmin(). See my image segmentation tutorial to learn how to find objects based on their intensity and crop them into new sub-images.
If you want to identify stretches of your 1D intensity profile vector obtained from improfile(), you can use thresholding:
aboveThreshold = yourProfileArray > someThresholdValue;
Not sure why you'd want to extract stretches of that 1D vector into individual short vectors, but if you tell me why, I'll tell you how to do it, or tell you how to do what you want to do without doing extracting sub-lines.

5 Comments

yeah... thanks a lot!!! i need to crop around the areas above the threshold using a rectangle.. so plz guide me on the same! quite new to this field..
I do guide you. Have you actually run the tutorial yet? When you do you'll see how I do exactly what you ask: cropping a rectangle around objects above a threshold. If you ran my tutorial and did not have it continue on to that part, then please do so. If the cropping I did is not what you want, then explain in more detail, preferably with images to illustrate your challenging situation.
I went through your tutorial.. However the coins are disconnected objects. I am planning to crop a region of the following image http://www.flickr.com/photos/25387007@N02/8391672834/in/photostream
I want to crop the joints of the bones only. As shown in http://www.flickr.com/photos/25387007@N02/8391689966/in/photostream
For this I have found the axis using hough lines http://www.flickr.com/photos/25387007@N02/8391676622/in/photostream
I intend to crop the joints based on gray level profiles along these axis. Just wanted you to know my intended procedure. Please take a look and guide me on the same. Thanks
Only yesterday got the image vth the roi shown.Thanks a lot for the help. will try to merge my algorithm vth cell segmentation rite now. will let u know if any difficulty arises.

Sign in to comment.

Categories

Find more on Read, Write, and Modify Image in Help Center and File Exchange

Asked:

on 11 Jan 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!