Deform Image: MLS

Share your advanced PureBasic knowledge/code with the community.
User avatar
Michael Vogel
Addict
Addict
Posts: 2677
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Re: Deform Image: MLS

Post by Michael Vogel »

Seems that the OpenCV libraries are doing a lot of stuff...

Some days ago I started to write a simple stretch function to be used as an external program for the Faststone Viewer to correct the perspective of photos. It uses the magick library (parameter -distort Perspective) for now but the lib is very large for this tiny stuff...

...can you tell me how to do a simple stretch for calculating a trapezium to a rectangle (or vice versa)?

Image
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: Deform Image: MLS

Post by JHPJHP »

Hi Michael Vogel,

See my reply to your question in the following OpenCV post: viewtopic.php?p=534612#p534612

-------------------------------------------------

Updated:
- selectable Border Color
- added support for single channel images
- some minor code improvements
- squashed a couple bugs

Border Color
Only accessible from the shortcut [ B ] Key.

NB*: Currently transparency is ignored, but should be included in the next release.
Last edited by JHPJHP on Sun Apr 07, 2019 5:18 am, edited 1 time in total.
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: Deform Image: MLS

Post by JHPJHP »

Updated:
- added four channel support for transparent images
- numerous minor improvements

NOTE:
The transparent background of a deformed PNG image can be changed to a solid color when the border color is changed from transparent and outputted to an animated GIF.
- Border Color defaults to transparent for PNG images and black for any other image type

Transparent Images
Using an FFmpeg Complex Filter I was able to output a transparent animated GIF, but using this method I was not able to modify the Disposal Method.
Not finding any documentation on the subject, I joined the FFmpeg Forum. After a few days without my question being answered, I wrote my own patch.

NB*: A version of the patch can be found in my GIF Toolkit download.

-----------------------------------------------------------------------

Updated:
- image sizes configured to use the built-in PureBasic DPI compiler option
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: Deform Image: MLS

Post by JHPJHP »

Updated:
- some minor improvements to Output Animated GIF
Locked