This is my sample image:
I want to convert it to rectangle (flat) image.
Please help.
How can I convert arc image to flat rectangle image
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How can I convert arc image to flat rectangle image
You would need to know the inverse transform used by -distort arc and the angle that was used to create it, which could be measured from the angle of the sides. You might be able to use -distort depolar with the angle and the other radii arguments. Otherwise, locate the four corners in your image and use the -distort perspective or -distort BilinearReverse.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How can I convert arc image to flat rectangle image
I can get kind of close using +distort depolar.
input:
First I pad the image with white to a height of 10,000 and invert it and draw lines.
http://www.fmwconcepts.com/misc_tests/a ... s_flip.png
I measure the angle between vertical and the lines at the edges. I also measure the inner and outer radii and the ratio of the difference in radii to 10,000. Then I use +distort depolar.
Then to check, I do an arc distort, which is similar but has different widths
input:
First I pad the image with white to a height of 10,000 and invert it and draw lines.
http://www.fmwconcepts.com/misc_tests/a ... s_flip.png
I measure the angle between vertical and the lines at the edges. I also measure the inner and outer radii and the ratio of the difference in radii to 10,000. Then I use +distort depolar.
Code: Select all
convert i3nc0kf.png -flip -virtual-pixel white +distort depolar \
"7140 5076 2436,2884 -19.4 +19.4" -flip -fuzz 10% -trim +repage -scale 100x20.6% tmp1c.png
Then to check, I do an arc distort, which is similar but has different widths
Code: Select all
convert tmp1c.png -virtual-pixel white +distort arc 38.8 tmp1c_arc.png