What is the correct way to affine / transform / rotate a set of coordinates
-
HI,
My application controls a device which essentially places item accurately on a surface according to a set of X-Y coordinates from a file. The surface position slightly varies relatively to the machine bed, it has 2 or 4 registration mark with known coordinates relative to it own origin.A set of multiple X-Y coordinates as well as the registration marks is extracted from the file.
With the help of a vision system and opencv the physical coordinates of the registration marks are verified against the machine bed and an offset from theoretical / ideal position is saved for each registration mark.
What I would like to do is to translate / rotate the whole set of X - Y coordinates according to these offsets, so that they account for the position error of the surface on the machine bed, allowing accurate placement.
I saw QT has some transformation functions for the graphical objects but my coordinates are variables and unrelated to the UI, so i wonder if i could use these transformation function (and how) or if i should use something else?
Thank you.
-
@Hoel said in What is the correct way to affine / transform / rotate a set of coordinates:
I saw QT has some transformation functions for the graphical objects but my coordinates are variables and unrelated to the UI, so i wonder if i could use these transformation function (and how) or if i should use something else?
You're talking about
QTransform
, right? You can in principle use it, however beside the convenience Qt may give you, probably it's going to be more straightforward to directly do that manually. An obvious caveat is that otherwise you need to prepare the data into a type Qt understands (thinkQPointF
). If you already have the data in a Qt type, then sure,QTransform
is just fine.