MATLAB Answers

Implementation of Snake Algorithmm for finding contours of Hand

조회 수: 55(최근 30일)
I am following a research paper in which contour of hand is determined as shown in Figure 4.
In this paper, snakes were used to perform segmentation. A snake can be defined as an energy-minimizing spline guided by external restraining forces and influenced by image forces, which tends to localize it in features such as lines and edges. It is therefore an active contour that evolves dynamically relevant to the contours of the image. The snake is represented as a parametric curve by r(s) = (x(s),y(s)), with s(0, 1). Its functional energy can be expressed as:
Where Eint represents the internal energy of the snake, Eimg image forces and Eres external restraining forces.
Can you help in coding for this?
This is the image whose contours I need to find.

  댓글 수: 4

표시 이전 댓글 수: 1
Explorer 6 Feb 2014
I need to make code for finding contour of hand as shown in figure 4 using snake algorithm.
How should I proceed?
Walter Roberson
Walter Roberson 7 Feb 2014
Asking how to proceed is an algorithms or theory question, not a MATLAB question.

Sign in to comment.

채택된 답변

Image Analyst
Image Analyst 6 Feb 2014
See my activecontour demo, attached. It will find the hand.

  댓글 수: 15

표시 이전 댓글 수: 12
Explorer 14 Feb 2014
Please provide demo code for this
First of all, start with a good image. Notice how the example had a nice uniform background while yours has pixels both brighter, darker, and the same as the hand. Maybe just try an edge detection and fill it in, that is if you can't get a uniform background where you can simply threshold. For example, maybe you can do a color segmentation to get just the hand. Compute hsv, then look for pixels with high saturation. The sleeve and background will have low saturation because they are neutral colored. If you can threshold, just threshold the saturation image and call bwboundaries().
Image Analyst
Image Analyst 14 Feb 2014
You can also try imgradient() which probably has demo code in the help.
Amy Phan
Amy Phan 2 Apr 2017
I tried this code but I'm not receiving any outline for my image. This is the outcome:
The image I'm using is an MRI image and I'm trying to use the snake method to outline the heart but I'm having issues with the thresholding. Any suggestions?

Sign in to comment.

추가 답변(2개)

snehal jaipurkar
snehal jaipurkar 22 Nov 2017
Sir how to save the segmented image after applying snake model in Matlab?????

  댓글 수: 1

Sign in to comment.

snehal jaipurkar
snehal jaipurkar 22 Nov 2017
And also I want to create a mask of the segmented image by putting the segmented part with intensity 1 and the rest of the part as zero. So how can I do that... Please please tell as soon as possible. Thanks alot in advance.

  댓글 수: 1

Image Analyst
Image Analyst 22 Nov 2017
My code does that. It's the "bw" in this line of code:
bw = activecontour(grayImage, mask, 400, 'edge');

Sign in to comment.

Translated by