Other Parts Discussed in Thread: TEST2
Tool/software:
Hi,
We would like to use tiovxldc GStreamer element to undistort our images.
In https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1058565/faq-tda4vm-how-to-create-a-ldc-mesh-lut-for-fisheye-distortion-correction-on-tda4 the LUT calculation is described well.
For the incoming 1280x944 image with m=4, (16x downscaling) the LUT file should contain a grid with the following resolution:
The mesh width is 1280 / 16 + 1 = 81;
The mesh height is 944 / 16 + 1 = 60;
The padded LUT pitch size = 81 * 2 * 2 = 324 rounded up to be 16 aligned = 336 bytes
So the full padded LUT mesh size is 336 * 60 = 20160 bytes.
We create a binary file that contains 10080 S16Q3 elements and try to specify that file as a LUT file for tiovxldc:
gs
t-launch-1.0 videotestsrc ! video/x-raw,width=1280,height=944 ! tiovxldc ldc-ds-factor=4 ldc-table-width=1280 ldc-table-height=944 lut-file=./binarylut.lut ! v4l2h265enc ! filesink location=test2.mp4
After launching a pipeline we get the following error:
[ERROR] 1503: readImage: Plane [0] bytes read = 20160, expected = 23040
I checked the original post and found the following image:
Here the SL2 size is the exact size our GStreamer pipeline expects.
If we check the "test_mesh_ldc_dcc.xml" mentioned in the original post our size calculation is correct, but somehow the tiovxldc GStreamer element expects an LDC LUT file with more content than the actual mesh_table_size:
We can't use a fixed, pre-generated DCC file as we need to change and re-calculate the distortion on the fly. Could you please help us how to generate a proper LDC LUT file that we can use with the tiovxldc GStreamer element?