Issues while executing image LDC sample

Please provide the following info (tick the boxes after creating this topic):
Software Version
DRIVE OS 6.0.10.0
DRIVE OS 6.0.8.1
DRIVE OS 6.0.6
DRIVE OS 6.0.5
DRIVE OS 6.0.4 (rev. 1)
DRIVE OS 6.0.4 SDK
other

Target Operating System
Linux
QNX
other

Hardware Platform
DRIVE AGX Orin Developer Kit (940-63710-0010-300)
DRIVE AGX Orin Developer Kit (940-63710-0010-200)
DRIVE AGX Orin Developer Kit (940-63710-0010-100)
DRIVE AGX Orin Developer Kit (940-63710-0010-D00)
DRIVE AGX Orin Developer Kit (940-63710-0010-C00)
DRIVE AGX Orin Developer Kit (not sure its number)
other

SDK Manager Version
2.1.0
other

Host Machine Version
native Ubuntu Linux 20.04 Host installed with SDK Manager
native Ubuntu Linux 20.04 Host installed with DRIVE OS Docker Containers
native Ubuntu Linux 18.04 Host installed with DRIVE OS Docker Containers
other

Issue Description
Hi team, I am trying to execute image ldc sample. But I am running into some issues and I want your help in this. The sample takes yuv file which is distorted and it makes this file undistorted after execution of this sample, right?
I opened one of the yuv files named “fisheye_1280_1080_yuv420. yuv”, by using “ffplay -f rawvideo -pixel_format yuv420p -video_size 1280x1080 fisheye_1280_1080_yuv420. yuv”
This is what I could see this yuv file (I could only see image, not video) attached below

Please help!

Error String
< Please provide just the error messages here >

Logs
This is what I could see after executing img ldc sample, is something wrong here?
nvidia@tegra-ubuntu:/opt/nvidia/drive-linux/samples/nvmedia/img_ldc$ ./nvmimg_ldc -cf ldc_basic.conf -v 3
nvmedia: ParseArgs: Validating params from config file
nvmedia: ParseArgs: Printing params from config file
(0) versionMajor = 3
(0) versionMinor = 0
(0) enableGeotrans = 0
(0) enableMaskMap = 0
(0) enableTnr = 0
(0) generateWarpMap = 0
(0) applyWarpMap = 0
(0) writeXSobel = 0
(0) writeXSobelDS = 0
(0) updateTnrParams = 0
(0) srcWidth = 1280
(0) srcHeight = 800
(0) srcRectx0 = 0
(0) srcRecty0 = 0
(0) srcRectx1 = 1280
(0) srcRecty1 = 800
(0) dstWidth = 1280
(0) dstHeight = 800
(0) dstRectx0 = 0
(0) dstRecty0 = 0
(0) dstRectx1 = 1280
(0) dstRecty1 = 800
(0) filter = 2
(0) model = 0
(0) k1 = 0.00
(0) k2 = 0.00
(0) p1 = 0.00
(0) p2 = 0.00
(0) k3 = 0.00
(0) k4 = 0.00
(0) k5 = 0.00
(0) k6 = 0.00
(0) fx = 0.00
(0) fy = 0.00
(0) cx = 0.00
(0) cy = 0.00
(0) R00 = 0.00
(0) R01 = 0.00
(0) R02 = 0.00
(0) R10 = 0.00
(0) R11 = 0.00
(0) R12 = 0.00
(0) R20 = 0.00
(0) R21 = 0.00
(0) R22 = 0.00
(0) T0 = 0.00
(0) T1 = 0.00
(0) T2 = 0.00
(0) targetKfx = 0.00
(0) targetKfy = 0.00
(0) targetKcx = 0.00
(0) targetKcy = 0.00
(0) ptMatrix00 = 0.00
(0) ptMatrix01 = 0.00
(0) ptMatrix02 = 0.00
(0) ptMatrix10 = 0.00
(0) ptMatrix11 = 0.00
(0) ptMatrix12 = 0.00
(0) ptMatrix20 = 0.00
(0) ptMatrix21 = 0.00
(0) ptMatrix22 = 0.00
(0) numHorRegion = 0
(0) numVerRegion = 0
(0) horRegionWidth0 = 0
(0) horRegionWidth1 = 0
(0) horRegionWidth2 = 0
(0) horRegionWidth3 = 0
(0) verRegionHeight0 = 0
(0) verRegionHeight1 = 0
(0) verRegionHeight2 = 0
(0) verRegionHeight3 = 0
(0) log2horSpace0 = 0
(0) log2horSpace1 = 0
(0) log2horSpace2 = 0
(0) log2horSpace3 = 0
(0) log2verSpace0 = 0
(0) log2verSpace1 = 0
(0) log2verSpace2 = 0
(0) log2verSpace3 = 0
(0) bitMaskFile =
(0) bitMaskWidth = 0
(0) bitMaskHeight = 0
(0) maskedPixelFillColor = 0
(0) maskY = 0.00
(0) maskU = 0.00
(0) maskV = 0.00
(0) spatialSigmaLuma = 0
(0) spatialSigmaChroma = 0
(0) rangeSigmaLuma = 0
(0) rangeSigmaChroma = 0
(0) sadMultiplier = 0.00
(0) sadWeightLuma = 0.00
(0) alphaSmoothEnable = 0
(0) alphaIncreaseCap = 0.00
(0) alphaScaleIIR = 0.00
(0) alphaMaxLuma = 0.00
(0) alphaMinLuma = 0.00
(0) alphaMaxChroma = 0.00
(0) alphaMinChroma = 0.00
(0) betaX1 = 0.00
(0) betaX2 = 0.00
(0) minBeta = 0.00
(0) maxBeta = 0.00
(0) checksumMode = 0
(0) warpMapFile =
(0) numControlPoints = 0
(0) numFrames = 1
(0) inputFile = /opt/nvidia/drive-linux/samples/nvmedia/img_ldc/fisheye_1280x1080_yuv420.yuv
(0) outputFile = /opt/nvidia/drive-linux/samples/nvmedia/img_ldc/out_fisheye_1280x800_yuv420.yuv
(0) xSobelFile =
(0) xSobelDSFile =
nvmedia: Library version: 8.1.0
nvmedia: Header version: 8.1.0
nvmedia: NvMediaLdcCreate done. LDC Handle:0xaaaad5f004a0
nvmedia: NvSciSync init is done
nvmedia: Creating surfaces:
nvmedia: Input surface 0xaaaad5f11bc0 created
nvmedia: Output surface 0xaaaad5f112c0 created
nvmedia: NvMediaLdcSetFilter called
nvmedia: NvMediaLdcSetGeometry called
nvmedia: NvMediaLdcSetChecksumMode called
nvmedia: Processing frame:0
nvmedia: ERROR: Can not open file
nvmedia: ERROR: ReadYUV failed! status = 7
nvmedia: Processed 0 frames, cleaning up
nvmedia: NvMediaLDCDestroy(pLDC:0xaaaad5f004a0) done

Please paste the complete application log here. If there are multiple logs, please use multiple text box

May I know the used DRIVE OS version ? I don’t see input files in sdk.
Also, did you check How to run nvmimg_ldc sample app - #4 by SivaRamaKrishnaNV ?

Dear @SivaRamaKrishnaNV
It’s DRIVE OS 6.0.8.1.
This yuv file is present at /drive/drive-linux/samples/Media/fisheye_1280_1080_yuv420.yuv

Dear @akshay.tupkar ,
I opened the same file in 7YUV and noticed 5 frame when scrolling down. Does that help to clarify ?

Dear @SivaRamaKrishnaNV
I executed the sample and it generated a “out_fisheye_1280x800_yuv420.yuv” file but I am not able to view it.

Dear @SivaRamaKrishnaNV
After executing the sample, I could see this out_fisheye_1280x800_yuv420.yuv file. Should I consider it as a undistorted?

Dear @akshay.tupkar ,
The image looks not correct. Could you share the used config and steps?

Dear @SivaRamaKrishnaNV
I have used ldc_basic.conf file and used command is “./nvmimg_ldc -cf ldc_basic.conf -v 3”

Dear @akshay.tupkar,
Could you check private message? I shared input video file and command used to test.

Hello, Ive tried following the steps suggested in the tagged topic here,

pomo@tegra-ubuntu:/opt/nvidia/drive-linux/samples/nvmedia/img_ldc$ ./nvmimg_ldc -cf ldc_gen_warpmap.conf -v 3
nvmedia: ParseArgs: Validating params from config file
nvmedia: ParseArgs: Printing params from config file
(0) versionMajor = 3
(0) versionMinor = 0
(0) enableGeotrans = 1
(0) enableMaskMap = 0
(0) enableTnr = 0
(0) generateWarpMap = 1
(0) applyWarpMap = 0
(0) saveWarpMap = 0
(0) writeXSobel = 1
(0) writeXSobelDS = 1
(0) updateTnrParams = 0
(0) srcWidth = 1280
(0) srcHeight = 1080
(0) srcRectx0 = 0
(0) srcRecty0 = 0
(0) srcRectx1 = 1280
(0) srcRecty1 = 1080
(0) dstWidth = 1280
(0) dstHeight = 1080
(0) dstRectx0 = 0
(0) dstRecty0 = 0
(0) dstRectx1 = 1280
(0) dstRecty1 = 1080
(0) filter = 2
(0) model = 1
(0) k1 = 0.00
(0) k2 = 0.00
(0) p1 = 0.00
(0) p2 = 0.00
(0) k3 = 0.00
(0) k4 = 0.00
(0) k5 = 0.00
(0) k6 = 0.00
(0) fx = 418.12
(0) fy = 418.12
(0) cx = 640.00
(0) cy = 400.00
(0) R00 = 1.00
(0) R01 = 0.00
(0) R02 = 0.00
(0) R10 = 0.00
(0) R11 = 1.00
(0) R12 = 0.00
(0) R20 = 0.00
(0) R21 = 0.00
(0) R22 = 1.00
(0) T0 = 0.00
(0) T1 = 0.00
(0) T2 = 0.00
(0) targetKfx = 418.12
(0) targetKfy = 418.12
(0) targetKcx = 640.00
(0) targetKcy = 400.00
(0) ptMatrix00 = 0.00
(0) ptMatrix01 = 0.00
(0) ptMatrix02 = 0.00
(0) ptMatrix10 = 0.00
(0) ptMatrix11 = 0.00
(0) ptMatrix12 = 0.00
(0) ptMatrix20 = 0.00
(0) ptMatrix21 = 0.00
(0) ptMatrix22 = 0.00
(0) numHorRegion = 2
(0) numVerRegion = 2
(0) horRegionWidth0 = 640
(0) horRegionWidth1 = 640
(0) horRegionWidth2 = 0
(0) horRegionWidth3 = 0
(0) verRegionHeight0 = 400
(0) verRegionHeight1 = 400
(0) verRegionHeight2 = 0
(0) verRegionHeight3 = 0
(0) log2horSpace0 = 1
(0) log2horSpace1 = 2
(0) log2horSpace2 = 0
(0) log2horSpace3 = 0
(0) log2verSpace0 = 1
(0) log2verSpace1 = 2
(0) log2verSpace2 = 0
(0) log2verSpace3 = 0
(0) bitMaskFile = 
(0) bitMaskWidth = 0
(0) bitMaskHeight = 0
(0) maskedPixelFillColor = 0
(0) maskY = 0.00
(0) maskU = 0.00
(0) maskV = 0.00
(0) spatialSigmaLuma = 0
(0) spatialSigmaChroma = 0
(0) rangeSigmaLuma = 0
(0) rangeSigmaChroma = 0
(0) sadMultiplier = 0.00
(0) sadWeightLuma = 0.00
(0) alphaSmoothEnable = 0
(0) alphaIncreaseCap = 0.00
(0) alphaScaleIIR = 0.00
(0) alphaMaxLuma = 0.00
(0) alphaMinLuma = 0.00
(0) alphaMaxChroma = 0.00
(0) alphaMinChroma = 0.00
(0) betaX1 = 0.00
(0) betaX2 = 0.00
(0) minBeta = 0.00
(0) maxBeta = 0.00
(0) checksumMode = 0
(0) warpMapFile = 
(0) warpMapOutFile = 
(0) numControlPoints = 0
(0) numFrames = 1
(0) inputFile = /opt/nvidia/drive-linux/samples/Media/fisheye_1280_1080_yuv420.yuv
(0) outputFile = /opt/nvidia/drive-linux/samples/Media/out_fisheye_1280x1080_yuv420.yuv
(0) xSobelFile = 
(0) xSobelDSFile = 
nvmedia: Library version: 11.0.0
nvmedia: Header version:  11.0.0
nvmedia: NvMediaLdcCreate done. LDC Handle:0xaaaafb80f2a0
nvmedia: ERROR: NvMediaLdcGenWarpMap failed! status = 1
nvmedia: Processed 0 frames, cleaning up
nvmedia: NvMediaLDCDestroy(pLDC:0xaaaafb80f2a0) done

I changed the resolution in the config file suggested, to match with that of the shipped .yuv file.
This didnt generate any output file for me though.

Dear @SivaRamaKrishnaNV
I have tried your command and it worked.
Thanks. I just want to know about ldc_gen_warpmap.conf file and why was it not working earlier with ldc_basic.conf file?

Dear @SivaRamaKrishnaNV
Could you please tell me where to find nvmedia_image.h and nvmedia_ldc.h files because i couldnt get it at /usr/include on host and on target too?

Dear @SivaRamaKrishnaNV
let’s say if i change the parameters in ldc_gen_warpmap.conf file, it should affect on output, right? I tried changing the parameters but still the output remains unaffected

Can you share the modified config file

Dear @SivaRamaKrishnaNV
I have modified some of the parameters just to observe the behaviour of output. But i could still see the undistorted output even after changing some values.
modified_ldc_gen_warpmap_conf.txt (2.6 KB)