File Exchange

image thumbnail


version (4.51 MB) by JKMSMKJ
Corrects perspective in an image.


Updated 29 Apr 2019

View Version History

View License

This app 'keystone corrects' a given image. Basically, it straightens merging lines to correct perspective as expected in photos of tall buildings, snapshots of display boards shot at an angle, etc. A discussion of the algorithm behind this app is given here: .
Any feature suggestions or comments are welcome. Thanks for trying the app (if you did, that is) and enjoy (the life, in general)!

Cite As

JKMSMKJ (2021). KeystoneCorrector (, MATLAB Central File Exchange. Retrieved .

Keystone Corrector (, JKMSMKJ (2019), MATLAB Central File Exchange. Retrieved April 29, 2019.

Comments and Ratings (8)

David Powers

Thanks, I updated Matlab to R2019b and it runs now.


David: It seems like you are trying to run KC on a MATLAB release that does not support GridLayout. KC has been tested on R2019a and R2019b. It may run on R2018b too but nothing earlier than that. Please try KC on a compatible MATLAB release and let me know if you still get errors. Thanks.
[If you do not mind installing a standalone app, you can visit the blogspot link in the description of this app and get that installer instead, which should run regardless of the MATLAB version you have.]

David Powers

Installs but doesn't run - errors

Error using KeystoneCorrectorApp/startApp (line 90)
Error defining property 'hpA' of class 'KeystoneC':
Class named 'matlab.ui.container.GridLayout' is undefined or does not support property validation.


Thanks Nikolay. I don't use the image processing toolbox so can't help you with the built-in functions.
I can share my basic code if you send me an email.

Nikolay Vinnichenko

Very nice app, but I need to correct for distortion series of images, so I will have to write my own code for this purpose. Could you tell me, what function do you use to warp the image after the parameters of transformation are determined? I tried to calibrate the camera, then using projective2d to determine transformation, invert and imwarp to correct the distortion, but this seems the wrong way, since imwarp produces downsampled image.


Chun-Jen Hsueh: Could you please let me know the error you get when trying to load an image? Thanks.

Chun-Jen Hsueh

This app doesn't work. I can not even read an image.

Kin Sung Chan

MATLAB Release Compatibility
Created with R2019a
Compatible with R2019a
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!