How to find a minimum cost path in Matlab. Something like this problem in C++
http://www.geeksforgeeks.org/dynamic-programming-set-6-min-cost-path/
any idea please.......

I found your function great, especially for object analysis in binary images. Can I as you only about how to extract the points(x,y) belong to both polygons that make the min distance

Why the x1 and x2 vector is 3XN (cause iam confused in this I have a mtaching points from both images (x1,y1 and x2 y2) there is no z with the matching points. except if I want to include the focal length in that case I will put in z component 1 if it is not available. Do I am right or not?

I am new to Matlab and I used Opensurf for feature matching between two images. the original image is (4064x2704)pixels. I used resize the images to lower resolution and OpenSurf perfectly working (Thanks for the Author) but when I used the original images size I got the following errors...
'''''''''''
??? Out of memory. Type HELP MEMORY for your options.

Error in ==> IntegralImage_IntegralImage at 31
I=I(:,:,1)*cR+I(:,:,2)*cG+I(:,:,3)*cB;

Error in ==> OpenSurf at 82
iimg=IntegralImage_IntegralImage(img);
''''''''''''''
is there ant idea please or suggestion...
Regards