Re: extracting biggest square from a rotated image
Posted: 2018-08-20T06:57:49-07:00
ok .
Here is the original 512x512 image -> https://ibb.co/cneSfz
Then I ran this command
convert f0001_01.png -rotate 15 -set option:leg "%[fx:512/(cos(15*(pi/180))+sin(15*(pi/180)))]" -set option:distort:viewport "%[leg]x%[leg]" \( -clone 0 -distort srt 0 \) -gravity center +swap -composite output.png
where f0001_01.png is the above original image.
output.png looked like this -> https://ibb.co/dBcxfz .
Notice that there is a triangle in bottom left corner .
Here is the original 512x512 image -> https://ibb.co/cneSfz
Then I ran this command
convert f0001_01.png -rotate 15 -set option:leg "%[fx:512/(cos(15*(pi/180))+sin(15*(pi/180)))]" -set option:distort:viewport "%[leg]x%[leg]" \( -clone 0 -distort srt 0 \) -gravity center +swap -composite output.png
where f0001_01.png is the above original image.
output.png looked like this -> https://ibb.co/dBcxfz .
Notice that there is a triangle in bottom left corner .