# How to Feed Images into Open CV Lens Distortion Calibrator

**URL:** <https://forums.unrealengine.com/t/how-to-feed-images-into-open-cv-lens-distortion-calibrator/488264>\
**Category:** Cinematics & Media\
**Tags:** opencv, unreal-engine, question, Blueprint\
**Created:** [September 1, 2021, 7:37am UTC](https://forums.unrealengine.com/t/how-to-feed-images-into-open-cv-lens-distortion-calibrator/488264 "2021-09-01T07:37:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hex21189](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Hex21189](https://forums.unrealengine.com/u/Hex21189)\
**Post date:** [September 1, 2021, 7:37am UTC](https://forums.unrealengine.com/t/how-to-feed-images-into-open-cv-lens-distortion-calibrator/488264/1 "2021-09-01T07:37:00Z")

</div>

Hello, I’m currently trying to use the OpenCv Lens Distortion plugin that comes installed by default with the Virtual Production example in Unreal 4.27 to try and create a camera undistortion texture for my camera. So far I have had no issue getting this to work with by manually setting the lens distortion parameters (K[1-6], P1, P2, etc.) but now I want to automatically generate this data using a series of images from my camera. To do this I threw together a blueprint (couldn’t get access to OpenCV from C++ scripts) that takes a directory, grabs all jpg files and feeds them into the calibrator.

 ![347793-blueprint.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/b/e/dbe566f17407004931920583249d37368249c92b.png)

Unfortunately no matter what I try the calibrator refuses to accept any of my test images, and since this is a blueprint I can’t really debug the problem any more, all I know is that the FeedImage node returns false for every image. I’ve tried searching for documentation or tutorials using OpenCV Lens Distortion but for some reason it is a completely undocumented feature besides a couple pages saying the nodes exist and 2 or 3 questions on this answer hub asking how to turn the distortion variables into a texture. If anyone knows what I might be missing please let me know.

Just for reference, here is a sample of one of my test images:

 ![347794-img-20210831-161340.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/4/3/24396a9abbb5ab63488f51543893f4b91c253866.jpeg)

Board Width: 10  
Board Height: 7  
Square Size: 3.2727 cm

Update:  
I was able to get OpenCV working directly from an external python script but I am still unable to get it working in Unreal. Obviously the functions are difference since Python deals directly with OpenCv while Unreal is using a blueprint wrapper but at least I know the images and calibrator settings should be valid.
