Equation for deskew?
Posted: 2016-03-01T03:19:41-07:00
Hello...
I have a line starting at an (x,y) coordinate and finishing at another (x,y) coordinate.
I want the line to be horizontal so I use the -deskew option.
The (x,y) coordinates at the start and end of the now horizontal line are slightly different to the original (x,y) coordinates.
My question is...
Deskew can output the angle of rotation it used to make the line horizontal. Is there an equation into which I can plug that angle and the original start and end coordinates and get back the start and end coordinates for the now horizontal line.
For clarity... below are a few examples giving the original start/end coordinates, the deskew angle and the resulting start/end coordinates for the now horizontal line. In real life, I have several hundred original coordinates and several hundred angles of rotation but no resulting horizontal line coordinates.
I would like to know if there is a quick mathematical way to find the horizontal line start/end coordinates as opposed to IM needing to run for many hours to get the same result.
Using Ubuntu 15.10 and IM 6.8.8-9
Thanks
Miguel
----
Line01.png
Original Line Coordinates - (145,154) (1688,109)
Deskew - angle of rotation: 1.65015
Horizontal Line Coordinates - (150,157) (1694,157)
Line02.png
Original Line Coordinates - (451,118) (1997,84)
Deskew - angle of rotation: 1.21679
Horizontal Line Coordinates - (455,127) (2003,127)
Line03.png
Original Line Coordinates - (87,148) (1634,93)
Deskew - angle of rotation: 3.02745
Horizontal Line Coordinates - (93,152) (1642,152)
Line04.png
Original Line Coordinates - (439,100) (1994,84)
Deskew - angle of rotation: 0.615458
Horizontal Line Coordinates - (443,106) (1997,106)
I have a line starting at an (x,y) coordinate and finishing at another (x,y) coordinate.
I want the line to be horizontal so I use the -deskew option.
The (x,y) coordinates at the start and end of the now horizontal line are slightly different to the original (x,y) coordinates.
My question is...
Deskew can output the angle of rotation it used to make the line horizontal. Is there an equation into which I can plug that angle and the original start and end coordinates and get back the start and end coordinates for the now horizontal line.
For clarity... below are a few examples giving the original start/end coordinates, the deskew angle and the resulting start/end coordinates for the now horizontal line. In real life, I have several hundred original coordinates and several hundred angles of rotation but no resulting horizontal line coordinates.
I would like to know if there is a quick mathematical way to find the horizontal line start/end coordinates as opposed to IM needing to run for many hours to get the same result.
Using Ubuntu 15.10 and IM 6.8.8-9
Thanks
Miguel
----
Line01.png
Original Line Coordinates - (145,154) (1688,109)
Deskew - angle of rotation: 1.65015
Horizontal Line Coordinates - (150,157) (1694,157)
Line02.png
Original Line Coordinates - (451,118) (1997,84)
Deskew - angle of rotation: 1.21679
Horizontal Line Coordinates - (455,127) (2003,127)
Line03.png
Original Line Coordinates - (87,148) (1634,93)
Deskew - angle of rotation: 3.02745
Horizontal Line Coordinates - (93,152) (1642,152)
Line04.png
Original Line Coordinates - (439,100) (1994,84)
Deskew - angle of rotation: 0.615458
Horizontal Line Coordinates - (443,106) (1997,106)