Popular Post toe_head2001 Posted August 24, 2016 Popular Post Share Posted August 24, 2016 (edited) Quadrilateral Correction Effects -> Tools -> Quadrilateral Correction Description This effect is useful for correcting images that have been skewed on multiple axes. It uses an algorithm from AForge.NET. It works very well, but don't expect miracles if your image is extremely skewed. Usage Output: Control Nubs The control nubs can be manipulated with the mouse in the following three ways: - Left Mouse Button — Grab and Drag - Middle Mouse Button — Grab and Drag with a Dead Zone - Right Mouse Button — Select nub for Keyboard Arrow manipulation - Arrow — 1px - Ctrl + Arrow — 5px Change Log v1.3.1 (Dec 16, 2021) Workaround for HiDPI bug in .NET 6 Merged dependencies into the main DLL v1.3 (March 13, 2021) Added: Reset button for Control Nub positions v1.2 (July 3, 2018) Added: Support for the Dark Theme Changed: Moved to the 'Tools' menu v1.1 (Jan 1, 2017) Fixed: Now works properly on HiDPI v1.0 (Aug 24, 2016) Initial release Download QuadrilateralCorrection.zip Donate Source Code https://github.com/toehead2001/pdn-quadrilateral-correction Icon based on icons from Fugue Icons. Edited June 24, 2022 by toe_head2001 fixed broken links 1 11 Quote (September 25th, 2023) Sorry about any broken images in my posts. I am aware of the issue. My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
MJW Posted August 26, 2016 Share Posted August 26, 2016 I finally had a chance to download and try this plugin, and it's very interesting and useful. (I wish the initial comment had a bit more detail on how it's used and perhaps a image of the UI.) Quote Link to comment Share on other sites More sharing options...
Eli Posted August 26, 2016 Share Posted August 26, 2016 Thanks toe_head2001, This effect is great for correcting skewed images such as photos of documents, posters, etc. Quote Link to comment Share on other sites More sharing options...
flaner Posted August 26, 2016 Share Posted August 26, 2016 I do not see what happens. Quote Link to comment Share on other sites More sharing options...
toe_head2001 Posted August 26, 2016 Author Share Posted August 26, 2016 (edited) Is moving the canvas to one side so hard? Even on your low resolution, you'll see most of your image. Spoiler Edited July 12, 2019 by toe_head2001 Quote (September 25th, 2023) Sorry about any broken images in my posts. I am aware of the issue. My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
lynxster4 Posted August 26, 2016 Share Posted August 26, 2016 Thank you, toe_head! This will come in handy! Quote My Art Gallery | My Shape Packs | ShapeMaker Mini Tut | Air Bubble Stained Glass Chrome Text with Reflections | Porcelain Text w/ Variegated Coloring | Realistic Knit PatternOpalescent Stained Glass | Frosted Snowman Cookie | Leather Texture | Plastic Text | Silk Embroidery Visit my Personal Website "Never, ever lose your sense of humor - you'll live longer" Link to comment Share on other sites More sharing options...
Shochi Posted September 7, 2016 Share Posted September 7, 2016 Amazing tool, required definitely as basic's. Quote Link to comment Share on other sites More sharing options...
toe_head2001 Posted January 1, 2017 Author Share Posted January 1, 2017 Version 1.1 post. Fixes the GUI on HiDPI. 4 Quote (September 25th, 2023) Sorry about any broken images in my posts. I am aware of the issue. My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
Seerose Posted January 2, 2017 Share Posted January 2, 2017 Dear @toe_head2001 ! Thank you for the new version. Quote Live as if you were to die tomorrow. Learn as if you were to live forever. Gandhi Link to comment Share on other sites More sharing options...
MJW Posted January 2, 2017 Share Posted January 2, 2017 toe_head2001, in the source code, I can't find the implementation of the QuadrilateralTransformation class. Quote Link to comment Share on other sites More sharing options...
toe_head2001 Posted January 2, 2017 Author Share Posted January 2, 2017 On 1/2/2017 at 2:08 PM, MJW said: toe_head2001, in the source code, I can't find the implementation of the QuadrilateralTransformation class. I just created the GUI, so the QuadrilateralTransformation class is in the AForge.NET libraries. https://github.com/andrewkirillov/AForge.NET/blob/master/Sources/Imaging/Filters/Transform/QuadrilateralTransformation.cs 1 Quote (September 25th, 2023) Sorry about any broken images in my posts. I am aware of the issue. My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
MJW Posted January 2, 2017 Share Posted January 2, 2017 Thanks, toe_head2001! Quote Link to comment Share on other sites More sharing options...
MJW Posted December 27, 2017 Share Posted December 27, 2017 Quadrilateral Correction always crops to the quadrilateral. I think that's often undesirable. When doing perspective correction, the typical approach would be to select some perspective-transformed rectangle in the scene, and put the nubs at its four corners. The purpose is not to isolate that particular region, but to provide the inverse-perspective information. I think Quadrilateral Correction would be more useful if the entire scene, outside the quadrilateral, could be displayed. That would probably require the ability to offset, scale, and modify the XY proportions of the transformed image. Also, as with any plugin of this sort, it should have the option of antialiasing. 1 Quote Link to comment Share on other sites More sharing options...
Eli Posted December 27, 2017 Share Posted December 27, 2017 I like it when the effect isolates a region, there is no need to crop it manually. But I also like MJW's idea, some people may want to keep the outer parts of the image. Quote Link to comment Share on other sites More sharing options...
Thorntod Posted February 5, 2018 Share Posted February 5, 2018 (edited) How about BOTH? 1) User places nubs on convenient "rectangle" in picture 2) QC Plugin performs correction on THE WHOLE IMAGE. (QC also auto-crops the image so there's no transparent area on any edge -- done to minimize croppage.) 3) QC Plugin SELECTS the orginal, now orthogonal, rectangle. 4) User has option to now CROP to the selected rectangle. As with any rectangular selection. In other words, I agree with MJW. Edited February 5, 2018 by Thorntod It used to say "bloody potatoe" ??? 1 Quote Link to comment Share on other sites More sharing options...
toe_head2001 Posted July 3, 2018 Author Share Posted July 3, 2018 Version 1.2 posted. I've added support for the Dark Theme, and moved it to the 'Tools' menu. On 12/27/2017 at 9:52 AM, Eli said: But I also like MJW's idea, some people may want to keep the outer parts of the image. Feel free to enlarge the canvas before running the plugin. I think that's the simplest solution. 2 1 Quote (September 25th, 2023) Sorry about any broken images in my posts. I am aware of the issue. My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
Seerose Posted July 4, 2018 Share Posted July 4, 2018 Dear @toe_head2001! Thank you so much. Quote Live as if you were to die tomorrow. Learn as if you were to live forever. Gandhi Link to comment Share on other sites More sharing options...
MJW Posted July 4, 2018 Share Posted July 4, 2018 On 7/3/2018 at 5:39 PM, toe_head2001 said: Feel free to enlarge the canvas before running the plugin. I think that's the simplest solution. I don't think that solves the problem (assuming it's considered a problem -- which it is by me). No matter how big the canvas is, the image is still clipped to the rectangle that corresponds to the transformed quadrilateral. Increasing the canvas size would merely increase the size of the transparent area surrounding the rectangle. I would like the option of preserving the region outside the rectangle. In that case, first increasing the canvas size would be useful, if the plugin didn't have the option of scaling and moving the transformed image, since otherwise either some areas of the image would move outside the canvas, or the transformed image would need to be downsized to fit the canvas. If you consider Eli's Aug. 26, 2016 example image it may be clearer. In many cases I'd want to use the picture Eli selects with the nubs to establish the perspective transformation, but keep all the surrounding structure in the transformed image, not just the picture, itself. 1 Quote Link to comment Share on other sites More sharing options...
thejack473 Posted July 7, 2018 Share Posted July 7, 2018 On 7/5/2018 at 1:10 AM, MJW said: No matter how big the canvas is, the image is still clipped to the rectangle that corresponds to the transformed quadrilateral. i think he means to make the canvas bigger and eyeball the sheet shape as if it was zoomed to the size of the entire image at the edges. like in my post. but this is hardly very scientific, a bit of a workaround and i agree we need this feature where you still choose the object corners but still get the full image morphed. but mostly, baby steps, i want anti-alias on/off. 1 2 Quote Link to comment Share on other sites More sharing options...
DocRoot Posted December 2, 2019 Share Posted December 2, 2019 This is a great plugin. Whilst the "cropping" is a great feature (and much used), I would also like to support the ability to make the crop "optional" - as discussed above. So that the transformation can optionally apply to the entire image (which probably means the canvas would need to be enlarged in these cases). Sometimes the convenient cues that you wish to use to straighten an image do not constitute the entire image. The equivalent "perspective correction" tool in "Paint Shop Pro" (PSP) does not crop by default and instead applies the transformation to the entire image. In these cases I crop the image after having performed the transformation. For example: (Screenshots from PSP) Quote Link to comment Share on other sites More sharing options...
toe_head2001 Posted December 2, 2019 Author Share Posted December 2, 2019 (edited) @DocRoot, Sorry, no can do (in this implementation anyway). Perhaps you missed the explanation I previously posted; here is the excerpt: Quote It uses an algorithm from AForge.NET. ... I just created the GUI In essence, the AForge.NET library is processing the image, and cropping it. I have no control over that. Plus, this plugin wouldn't be able to enlarge the canvas size to accommodate the larger image. I see you gave rep points to for the workaround that I and @thejack473 talked about. I suggest you use it. Or just use PSP. Sure it's not ideal, but there's no reason you can't have more than one graphic program in your workflow. Use the right tool for the job. Edited December 2, 2019 by toe_head2001 Quote (September 25th, 2023) Sorry about any broken images in my posts. I am aware of the issue. My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
andy_p Posted June 29, 2020 Share Posted June 29, 2020 I haven't thought this through properly, but to increase the size of the transformed area, could the coordinates of the control rectangle be massaged a bit, e.g. scaling it up to the edge of the image, before passing it to the AForge algorithm? This would provide some attempt at transforming the surroundings. I don't know if naively scaling it would change the perspective effect though, I haven't looked at the maths. A cheap fix for the anti-aliasing would be to enlarge the picture x2, perform the transform, then shrink it x2 again. There is a property on the transform that "specifies if bilinear interpolation should be used or not" which defaults to "true" so maybe it is doing it already. Quote Link to comment Share on other sites More sharing options...
Mike Shawn Posted March 9, 2021 Share Posted March 9, 2021 Great tool for fixing documents shot with a phone camera. I've learned to expand the canvas size if I don't want to lose any of the image, though the result is sometimes living with a clipped corner. My main reason for writing though is to ask if a reset function can be added. I work with groups of images and it slows me down having to reset the control nubs to each corner. Once in awhile it helps to have the last setting, but that tends to be the exception when shooting images with a hand held phone. A simple "reset" would be awesome. Thanks. Quote Link to comment Share on other sites More sharing options...
toe_head2001 Posted March 9, 2021 Author Share Posted March 9, 2021 2 hours ago, Mike Shawn said: My main reason for writing though is to ask if a reset function can be added. Sure, I'll get a reset added some time this week. 1 Quote (September 25th, 2023) Sorry about any broken images in my posts. I am aware of the issue. My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
toe_head2001 Posted March 13, 2021 Author Share Posted March 13, 2021 Version 1.3 posted. Download is in the first post. This version add a Reset button for the Control Nub positions. 2 4 Quote (September 25th, 2023) Sorry about any broken images in my posts. I am aware of the issue. My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.