Hi,
I am transmitting a live camera from machine via UDP.
And receiving at receiver. The camera is with lens and provide 192 HFOV with distortion (curvy). Captured Image shown below:
My intention is to obtain a flat 2D image out of this camera and hence trying to implement nvdewarper with distortion correction in dewraper config file.
My Expectation:
(picture is just from reference)
I have received two types of distortion coefficients from our supplier, shown below:
1> IMX390_192HFOV_equidistant
camera_matrix:
cols: 3
data: [611.6874866752892, -0.26367039445399043, 965.5248614879346, 0.0, 610.7760208904261,
555.8064824881836, 0.0, 0.0, 1.0]
rows: 3
camera_name: IMX390_192HFOV
distortion_coefficients:
cols: 4
data: [-0.03295389707943418, -0.026429041872853543, 0.026566389925398635, -0.009267671163848717]
rows: 1
distortion_model: equidistant
image_height: 1096
image_width: 1936
projection_matrix:
cols: 4
data: [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0]
rows: 3
rectification_matrix:
cols: 3
data: [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0]
rows: 3
2> IMX390_192HFOV_plumb_bob
camera_matrix:
cols: 3
data:
- 652.5771400378992
- 0.0
- 966.5794318241657
- 0.0
- 651.6950976471154
- 558.2694892223593
- 0.0
- 0.0
- 1.0
rows: 3
camera_name: IMX390_192HFOV
distortion_coefficients:
cols: 5
data: - -0.3002562235144459
- 0.0783848772023062
- -0.0003913208983429832
- 5.759098689473573e-05
- -0.008314964125280827
rows: 1
distortion_model: plumb_bob
image_height: 1096
image_width: 1936
projection_matrix:
cols: 4
data: - 1.0
- 0.0
- 0.0
- 0.0
- 1.0
- 0.0
- 0.0
- 0.0
- 1.0
- 0.0
- 0.0
- 0.0
rows: 3
rectification_matrix:
cols: 3
data: - 1.0
- 0.0
- 0.0
- 0.0
- 1.0
- 0.0
- 0.0
- 0.0
- 1.0
rows: 3
My Environment:
1> Operating System : Linux-x86_64 Ubuntu v20.04
2> Deepstream v6.1
3> Camera modules: IMX390_192HFOV, resolution: 1936 x 1096
Pipeline:
gst-launch-1.0 udpsrc port=5000 ! application/x-rtp,encoding-name=VP9,payload=96 ! rtpvp9depay ! queue ! nvv4l2decoder ! nvvideoconvert ! nvdewarper config-file=config_dewarper_perspective.txt source-id=0 nvbuf-memory-type=3 ! m.sink_0 nvstreammux name=m width=1920 height=1080 batch-size=1 num-surfaces-per-frame=1 ! nvmultistreamtiler ! nvvideoconvert ! fpsdisplaysink sync=false -e
nvdewarper Configuration File:
----- config file start ------
################################################################################
[property]
#dewarp-dump-frames=10
output-width=1936
output-height=1096
num-batch-buffers=1
#########################################
#Note - Max 4 surfaces are supported
#########################################
[surface0]
#1=PushBroom, 2=VertRadCyl, 3=PerspectivePerspective
projection-type=3
width=1936
height=1096
focal-length=1721.592
#src-fov=180
#top-angle=30
#bottom-angle=-30
distortion=-0.03295389707943418;-0.026429041872853543;0.026566389925398635;-0.009267671163848717
src-x0=1861.88
src-y0=1216.04
#0=cudaAddressModeClamp, 1=cudaAddressModeBorder
#cuda-address-mode=0
---------config file end --------------------
Results I am getting by implementing both the distortion coefficients are as below:
1> IMX390_192HFOV_equidistant=
distortion_coefficients: -0.03295389707943418, -0.026429041872853543, 0.026566389925398635, -0.009267671163848717
2> IMX390_192HFOV_plumb_bob=
distortion_coefficients: -0.3002562235144459
- 0.0783848772023062
- -0.0003913208983429832
- 5.759098689473573e-05
- -0.008314964125280827
Help Needed:
Can anyone guide what should I modify in my config file to get best flat 2D image by implement distortion.
How can I obtain flat 2D image with every thing looking straight rather than curvy?
Did I implemented nvdewarper correctly or need some properties to set for best result?