Points in Poly

Hi,

Doing some image analysis and the work flow includes defining large particles and applying a convex hull (with /c flag for closing a polygon).  I then do a thinning to form a skeleton with matrixfilter.  A bit more manipulation to enhance the nodes of the skeleton, where a branch occurs, and do imageanalyzeparticles to get the x,y locations of the nodes.

The task at hand is count the number of nodes in each particle and the plan is to use the convex hull to define the polygon and then use find pointsinpoly using the x,y locations of the nodes and get a simple sum. And as you may have guessed by now it is not working to my simple expectation.  The minimum experiment is attached and there is a function called node_count(variable input) which prints the number of nodes found within a given convex hull.  Most of the time it returns zero, but for particle 3 it returns 10 which if you count is the wrong answer.

Where have I gone wrong?

Andy

points points in poly.pxp