public double PointLineDistanceInWorld(double x, double y, Line line, bool display = true)
        {
            HTuple distanceWorld, distancePixel;

            HalconScripts.DistancePLInWorld(line.XStart, line.YStart, line.XEnd, line.YEnd, x, y, _mapToWorld,
                                            out distanceWorld, out distancePixel);

            if (display)
            {
                HTuple xIntersect, yIntersect;
                HalconScripts.get_perpendicular_line_that_passes(line.XStart, line.YStart, line.XEnd, line.YEnd, x, y,
                                                                 out xIntersect, out yIntersect);
                PointLineDistanceGraphics.Add(new Line(x, y, xIntersect.D, yIntersect.D));
            }

            return(distanceWorld.D);
        }