Hi yashpal,
For a max distance or min distance horizontal clamp (like shown in the figure on this page for a
Clamp Example),
the two red edges are drawn parallel to each other, exactly vertical,
and perpendicular to the horizontal distance across the image. Because
they are parallel, the x-distance between the lines would be the same
no matter how far up or down on the lines you look at (see the
Wikipedia page on
parallel lines
and especially the figure for Definition 1 of Euclidian parallelism).
So you could just subtract the x-coordinates of the two returned
coordinate pairs to get the horizontal distance. Since this is the same
as the "distance" value returned by the Clamp VI, I'm not sure what you
are trying to do that the VI doesn't already do. Can you elaborate more
on this?
To continue the above example, if your returned coordinates were for
example (33, 45) and (121, 78), the edges would extend direclty
vertically from there, covering all Y-points for those x-values. So the
edges would be along (33, 0), (33, 1), (33, 2)... all the way to (33,Y)
and (121, 0), (121, 1)... to (121, Y), where Y is the height of the
image. In algebra or geometry, this would be the same as drawing lines
which are defined by x=33 and x=121. Or you might consider the edge to
only stop at the edges of the ROI/Rectangle box over which your clamp
measurements take place. Then the y-coordinates wouldn't go from 0 to
Y, they'd go from the first y-coordinate of the rectangle to the last
y-coordinate of your rectangle box.