Slope Magnitude Technique with Sobel Operator

I have to extract shape by
Slope Magnitude Technique with Sobel Operator
Slope Magnitude Technique with canny Operator
Slope Magnitude Technique with roberts Operator
can anyone tell hoe to process
I have to extract the shape using three methods,i have posted for other three methods ,i colud not find any answer,else is there any methods other than these to extract shape
please help

 Accepted Answer

As Walter says, it's not clear what you mean by extracting shape. I'm also not sure whether you want help in implementing the three measures that you mention, or whether you want people to propose alternatives to them.
In case it helps, here is some information about obtaining the magnitude of the gradient of an image (which is what I guess you mean by slope magnitude). You can get orthogonal components of the gradient by convolution with differencing operators, such as the Sobel or Roberts operators. You can easily find the form of these simple operators (e.g. on Wikipedia) and then use conv2 to apply them to the image. By 'Canny operator' I think you probably mean the first derivative of the Gaussian, since that is what is used in the first stage of the Canny edge detector.
Here's an example of getting the square of the gradient magnitude using 'Canny' operators. I use this file exchange submission to do the convolutions.
im = double(imread('pout.tif'))/256;
>> [xg, yg] = gradients_xy(im, 5, false, [1 size(im,1) 1 size(im,2)]);
>> gsq = xg.^2 + yg.^2;
>> imshow(gsq, []);
The Roberts and Sobel methods are actually simpler, but as they have no smoothing they are likely to produce a noisy result on real images, and I'm not sure why you would want to use them.
EDIT I have changed and simplified the arguments for gradients_xy. If you download the function from the FEX after 8 Dec 2012, you should change the call above to:
[xg, yg] = gradients_xy(im, 5, 'same');

4 Comments

Thanks David for your code,I got one method ,i need two other methods which can define shape feature,can u help please,any method relating to extraction of shape i.e extract feature descriptions
The problem is that this is just such an open question. Where to start? Textbooks are good for getting on overview of such a big field, and you'll find a relevant list on Wikipedia, at http://en.wikipedia.org/wiki/Feature_extraction
To select some methods, I'd need to know about the application. If it's just a general exercise, then perhaps blob detection and corner detection might be reasonable approaches to explore - but note that others may well have different views.
plz explain any other easymethods to extractfeatures please
You can use thresholding, or color segmentation.

Sign in to comment.

More Answers (1)

You cannot extract the shape using those techniques, nor any of the techniques you posted about earlier. Referring to one of your earlier threads, it is meaningless to "indicate the shape" of a tree.
You can extract feature vectors and object metrics from images, but those are not the same thing as the "shape" of an object.

3 Comments

ok walter ,in feature extraction of an image,one is shape,i want to extract it by any 3 methods,u said it cannot be extracted,can u suggest ,what can be done please
You wrote: "in feature extraction of an image,one is shape". I have not found any evidence of that. What I do find evidence of is that one can extract feature descriptions *of* a shape -- not that one can extract the shape itself.
Sorry walter i need to extract features ,please help

Sign in to comment.

Categories

Asked:

Pat
on 6 Dec 2011

Commented:

on 15 Dec 2018

Community Treasure Hunt

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

Start Hunting!