Deform Image: MLS

Share your advanced PureBasic knowledge/code with the community.
User avatar
JHPJHP
Addict
Addict
Posts: 1851
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Deform Image: MLS

Post by JHPJHP »

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

Download Deform Image: MLS from My PureBasic Stuff

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

A standalone OpenCV application (PureBasic Interface to OpenCV not required).
- similar to the Funny Face app available for most smart phones

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

Announcements
PureBasic Interface to OpenCV
PureBasic Interface to WinDivert
PureBasic Interface to WinRAR
PureBasic Interface to 7-Zip
PureBasic Interface to ImDisk
Windows Services & Other Stuff
Invading Space Aliens
Death Star vs Asteroids
GIF Toolkit
LSB Image Steganography
Spider Web Drawing
Deform Image: MLS
Video Snipping Tool
Chromium Edge WebGadget
IAccessible Interface
Stitch Images: SIFT
OldSkool Fire Effect
Image Waves: LUT
YouTube Player & Downloader
MP4 Player & Downloader
Large Image Viewer
Barcode Generator
Google Translate Service
Embed JS into PureBasic
Geolocation: Google Maps
Book & Viewer & Magnify
Video for Windows: VfW
Alternate Console
Network Share Management

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

Anchor Points: Static points placed around the border to pin the frame in-place (YELLOW).
Control Point: Dynamic point used to either pin an area in-place or expanded to Deform Points (BLUE).
Deform Points: Dynamic points used to either deform an area or reset to a Control Point (GREEN connecting RED).

Points are calculated relative to the original image, which is why it can be more accurate to add all the Control Points before executing a deformation.
Alternately, you can switch to the original image to place additional Control Points, but it is not required.

- Control Points and Deform Points can be selected, moved, and deleted
- adjusting the grid size will directly affect the deformation algorithms, modifying the deformation

QUICK DEMO
* List of Shortcut Keys available from Enable Help Tooltips (context menu)
1. Press the [ L ] KEY to load a set of point files.
-- /points/joker.src
2. Press the [ R ] KEY to run the deformed animation.
Last edited by JHPJHP on Sat Oct 16, 2021 8:55 pm, edited 62 times in total.

STATUS: Mostly Unavailable :: Downloads moved to My PureBasic Stuff; free executables, access key required for source code.
_________________
User avatar
JHPJHP
Addict
Addict
Posts: 1851
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Deform Image: MLS :: [ an OpenCV application ]

Post by JHPJHP »

A while ago, I released an older version of the program, but removed it after having trouble with my download site.
- a similar example can be found in PureBasic Interface to OpenCV: cv_MLS_deformation.pb

MLS Deformation: Based on script from here.

Demo JavaScript version provided by the original author: Warp Image.

Additional Information: Image Deformation Using Moving Least Squares.

Image

Image
Last edited by JHPJHP on Thu Jul 12, 2018 3:39 am, edited 1 time in total.

STATUS: Mostly Unavailable :: Downloads moved to My PureBasic Stuff; free executables, access key required for source code.
_________________
User avatar
JHPJHP
Addict
Addict
Posts: 1851
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: Deform Image: MLS :: [ an OpenCV application ]

Post by JHPJHP »

Fred before and after a full day of working with PureBasic; feel the power :!:

Image Image

STATUS: Mostly Unavailable :: Downloads moved to My PureBasic Stuff; free executables, access key required for source code.
_________________
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Re: Deform Image: MLS :: [ an OpenCV application ]

Post by djes »

:lol:
User avatar
JHPJHP
Addict
Addict
Posts: 1851
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: Deform Image: MLS :: [ an OpenCV application ]

Post by JHPJHP »

Updated:
- binaries from OpenCV v2.4.13.3 to OpenCV v2.4.13.6
- added DPI awareness: SetProcessDpiAwarenessContext

STATUS: Mostly Unavailable :: Downloads moved to My PureBasic Stuff; free executables, access key required for source code.
_________________
User avatar
JHPJHP
Addict
Addict
Posts: 1851
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: Deform Image: MLS

Post by JHPJHP »

Updated:
- added Control Window
- some minor improvements

Control Window
Includes all the same options available from the Context Menu.

Quick Demo:
1. Load (default) Points Files
2. Run Deformed Animation

Image

STATUS: Mostly Unavailable :: Downloads moved to My PureBasic Stuff; free executables, access key required for source code.
_________________
User avatar
Kwai chang caine
Addict
Addict
Posts: 4968
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Deform Image: MLS

Post by Kwai chang caine »

Works fine here on W10 X64 / V5.70 X86
I have run "Run deformed animation" and it's really fun to see the works do alone :shock:
Thanks for sharing 8)
ImageThe happiness is a road...
Not a destination
User avatar
JHPJHP
Addict
Addict
Posts: 1851
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: Deform Image: MLS

Post by JHPJHP »

Hi Kwai chang caine,

As always thank you for your comments and feedback.

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

Updated:
- extended shortcut keys to Control Window
- squashed a couple bugs

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

Updated:
- some minor improvements
- added a second example

Image Image

STATUS: Mostly Unavailable :: Downloads moved to My PureBasic Stuff; free executables, access key required for source code.
_________________
Little John
Addict
Addict
Posts: 4007
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: Deform Image: MLS

Post by Little John »

Hi JHPJHP,

if you'll find a way to remove wrinkles, you can sell it to thousands and millions of ladies and get rich fast. :D
Please excuse my flawed English. My native language is PureBasic.
Search
RSBasic's backups
User avatar
JHPJHP
Addict
Addict
Posts: 1851
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: Deform Image: MLS

Post by JHPJHP »

Hi Little John,
Little John wrote:if you'll find a way to remove wrinkles, you can sell it to thousands and millions of ladies and get rich fast.
You may be on to something, but the market for woman is already saturated with products; I was thinking...

Image

STATUS: Mostly Unavailable :: Downloads moved to My PureBasic Stuff; free executables, access key required for source code.
_________________
Little John
Addict
Addict
Posts: 4007
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: Deform Image: MLS

Post by Little John »

:lol:
Please excuse my flawed English. My native language is PureBasic.
Search
RSBasic's backups
User avatar
JHPJHP
Addict
Addict
Posts: 1851
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: Deform Image: MLS

Post by JHPJHP »

Updated:
- added Output Animated GIF

Output Animated GIF
FFmpeg Windows binaries are used to create the animated GIF.

Quick Demo
1. Load (default) Points Files
2. Output Animated GIF

NB*: Download size has increased due to the FFmpeg Windows binaries.

STATUS: Mostly Unavailable :: Downloads moved to My PureBasic Stuff; free executables, access key required for source code.
_________________
User avatar
JHPJHP
Addict
Addict
Posts: 1851
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: Deform Image: MLS

Post by JHPJHP »

Updated:
- optimized Output Animated GIF
- updated the FFmpeg binaries

Output Animated GIF
Previously 32 images were used to create the GIF animation, this has been reduced to 16 images.

Image

STATUS: Mostly Unavailable :: Downloads moved to My PureBasic Stuff; free executables, access key required for source code.
_________________
User avatar
Josh
Addict
Addict
Posts: 1184
Joined: Sat Feb 13, 2010 3:45 pm

Re: Deform Image: MLS

Post by Josh »

OMG, I am curious what we can expect from KCC with this tool :mrgreen:
sorry for my bad english
User avatar
JHPJHP
Addict
Addict
Posts: 1851
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: Deform Image: MLS

Post by JHPJHP »

Hi Josh,
Josh wrote:OMG, I am curious what we can expect from KCC with this tool
I think I had Kwai chang caine in mind when I added the Output GIF option :)

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

Updated:
- minor cosmetic and code improvements
- added ADS - Alternate Data Streams

ADS - Alternate Data Streams
Saves the Control Window and Help Tooltips state; only applies to the executable.

NB*: Reset Image & Settings will not affect the Control Window or Help Tooltips state; only applies to the executable.

STATUS: Mostly Unavailable :: Downloads moved to My PureBasic Stuff; free executables, access key required for source code.
_________________
Post Reply