0

I've successfully calibrated my camera and I can get the dimensions of a XLD in world coordinates with ContourToWorldPlaneXld and then HeightWidthRatioXld. This returns me the measures of a contour extracted from a shape.

Now I need to convert a value inserted by the user in mm (example in mm: 0.1) and get how many pixels the measure is, for example, to draw a line.

I need the pixel value as per request. I tried looking around in the Halcon documentation but I didn't find what I was looking for.
Also I read this answer but it' not exactly what I'm looking for.

I'm using Halcon Progress 21.11.

Edit: A possible solution could be obtaining the dimensions before converting them to world plane and then do something like pixel/world but I would prefer a better method if it exists.

erik7854
  • 150
  • 1
  • 16
  • To me it seems, that the answer you are referring to is an answer to your question. Could you explain how is this different? – Vladimir Perković Apr 22 '22 at 15:27
  • @VladimirPerković yes, if you are referring to the edit I made. It is working and seems pretty accurate. In my question I was wondering if there was a dedicated method in Halcon to transform a measure from and to pixel given the camera parameters and pose, similar to what ContourToWorldPlaneXld does for example – erik7854 Apr 22 '22 at 15:42
  • 1
    I don't think there is a direct method in Halcon. – Vladimir Perković Apr 22 '22 at 15:49

0 Answers0