MATLAB: How to judge a point whether inside a closed contour or not

Image Processing Toolboxmatlab function contour

Assume a circle contour image matrix
c= [ 0 0 0 0 1 0 0 0 0
0 0 0 1 0 1 0 0 0
0 0 1 0 0 0 1 0 0
0 1 0 0 0 0 0 1 0
0 1 0 0 0 0 0 1 0
0 0 1 0 0 0 1 0 0
0 0 0 1 0 1 0 0 0
0 0 0 0 1 0 0 0 0 ]
and a point p=[4 3], apparently inside this circle. But, how to make such judgement in matlab.

Best Answer

http://www.mathworks.com/help/images/ref/imfill.html imfill ('holes'). If the point gets assigned a non-zero value then it is inside a closed contour.