Are Kitti 2015 stereo dataset images already rectified? - camera-calibration

I am trying to test my Stereo matching algorithm on Kitti 2015 stereo dataset
http://www.cvlibs.net/datasets/kitti/eval_scene_flow.php?benchmark=stereo. My algorithm assumes that the stereo cameras are well calibrated and the stereo images already rectified.
Are the Kitti 2015 images already rectified ? or do I need to rectify them ? if yes how to do this in OpenCV using the info provided in the calibration file?
calib_time: 09-Jan-2012 13:57:47
corner_dist: 9.950000e-02
S_00: 1.392000e+03 5.120000e+02
K_00: 9.842439e+02 0.000000e+00 6.900000e+02 0.000000e+00 9.808141e+02 2.331966e+02 0.000000e+00 0.000000e+00 1.000000e+00
D_00: -3.728755e-01 2.037299e-01 2.219027e-03 1.383707e-03 -7.233722e-02
R_00: 1.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 1.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 1.000000e+00
T_00: 2.573699e-16 -1.059758e-16 1.614870e-16
S_rect_00: 1.242000e+03 3.750000e+02
R_rect_00: 9.999239e-01 9.837760e-03 -7.445048e-03 -9.869795e-03 9.999421e-01 -4.278459e-03 7.402527e-03 4.351614e-03 9.999631e-01
P_rect_00: 7.215377e+02 0.000000e+00 6.095593e+02 0.000000e+00 0.000000e+00 7.215377e+02 1.728540e+02 0.000000e+00 0.000000e+00 0.000000e+00 1.000000e+00 0.000000e+00
S_01: 1.392000e+03 5.120000e+02
K_01: 9.895267e+02 0.000000e+00 7.020000e+02 0.000000e+00 9.878386e+02 2.455590e+02 0.000000e+00 0.000000e+00 1.000000e+00
D_01: -3.644661e-01 1.790019e-01 1.148107e-03 -6.298563e-04 -5.314062e-02
R_01: 9.993513e-01 1.860866e-02 -3.083487e-02 -1.887662e-02 9.997863e-01 -8.421873e-03 3.067156e-02 8.998467e-03 9.994890e-01
T_01: -5.370000e-01 4.822061e-03 -1.252488e-02
S_rect_01: 1.242000e+03 3.750000e+02
R_rect_01: 9.996878e-01 -8.976826e-03 2.331651e-02 8.876121e-03 9.999508e-01 4.418952e-03 -2.335503e-02 -4.210612e-03 9.997184e-01
P_rect_01: 7.215377e+02 0.000000e+00 6.095593e+02 -3.875744e+02 0.000000e+00 7.215377e+02 1.728540e+02 0.000000e+00 0.000000e+00 0.000000e+00 1.000000e+00 0.000000e+00
S_02: 1.392000e+03 5.120000e+02
K_02: 9.597910e+02 0.000000e+00 6.960217e+02 0.000000e+00 9.569251e+02 2.241806e+02 0.000000e+00 0.000000e+00 1.000000e+00
D_02: -3.691481e-01 1.968681e-01 1.353473e-03 5.677587e-04 -6.770705e-02
R_02: 9.999758e-01 -5.267463e-03 -4.552439e-03 5.251945e-03 9.999804e-01 -3.413835e-03 4.570332e-03 3.389843e-03 9.999838e-01
T_02: 5.956621e-02 2.900141e-04 2.577209e-03
S_rect_02: 1.242000e+03 3.750000e+02
R_rect_02: 9.998817e-01 1.511453e-02 -2.841595e-03 -1.511724e-02 9.998853e-01 -9.338510e-04 2.827154e-03 9.766976e-04 9.999955e-01
P_rect_02: 7.215377e+02 0.000000e+00 6.095593e+02 4.485728e+01 0.000000e+00 7.215377e+02 1.728540e+02 2.163791e-01 0.000000e+00 0.000000e+00 1.000000e+00 2.745884e-03
S_03: 1.392000e+03 5.120000e+02
K_03: 9.037596e+02 0.000000e+00 6.957519e+02 0.000000e+00 9.019653e+02 2.242509e+02 0.000000e+00 0.000000e+00 1.000000e+00
D_03: -3.639558e-01 1.788651e-01 6.029694e-04 -3.922424e-04 -5.382460e-02
R_03: 9.995599e-01 1.699522e-02 -2.431313e-02 -1.704422e-02 9.998531e-01 -1.809756e-03 2.427880e-02 2.223358e-03 9.997028e-01
T_03: -4.731050e-01 5.551470e-03 -5.250882e-03
S_rect_03: 1.242000e+03 3.750000e+02
R_rect_03: 9.998321e-01 -7.193136e-03 1.685599e-02 7.232804e-03 9.999712e-01 -2.293585e-03 -1.683901e-02 2.415116e-03 9.998553e-01
P_rect_03: 7.215377e+02 0.000000e+00 6.095593e+02 -3.395242e+02 0.000000e+00 7.215377e+02 1.728540e+02 2.199936e+00 0.000000e+00 0.000000e+00 1.000000e+00 2.729905e-03

Related

Reproducing KITTI calibration format from Autoware lidar-camera calibration

Autoware calibration file for the camera-LiDAR setup:
%YAML:1.0
CameraExtrinsicMat: !!opencv-matrix
rows: 4
cols: 4
dt: d
data: [ 5.7485824720057921e-02, -2.2015060517438068e-02,
9.9810356029155001e-01, 1.5871758460998535e+00,
-9.9773309474674776e-01, -3.6302750979794518e-02,
5.6663761950436042e-02, 3.3742961287498474e-01,
3.4986448852825702e-02, -9.9909831717489750e-01,
-2.4052048040780927e-02, -7.8092020750045776e-01, 0., 0., 0., 1. ]
CameraMat: !!opencv-matrix
rows: 3
cols: 3
dt: d
data: [ 3.4264173924362385e+03, 0., 1.1750055482979822e+03, 0.,
3.4271319432011160e+03, 7.0638529565366980e+02, 0., 0., 1. ]
DistCoeff: !!opencv-matrix
rows: 1
cols: 5
dt: d
data: [ -3.9114669187524842e-01, 2.0517211877662116e+00,
1.3425702389588642e-03, -1.0323895351449207e-03,
-8.2463512974303352e+00 ]
ImageSize: [ 2064, 1544 ]
ReprojectionError: 0
DistModel: plumb_bob
KITTI calibratio file for a pair of image and its corresponding velodyne point cloud:
P0: 7.215377000000e+02 0.000000000000e+00 6.095593000000e+02 0.000000000000e+00 0.000000000000e+00 7.215377000000e+02 1.728540000000e+02 0.000000000000e+00 0.000000000000e+00 0.000000000000e+00 1.000000000000e+00 0.000000000000e+00
P1: 7.215377000000e+02 0.000000000000e+00 6.095593000000e+02 -3.875744000000e+02 0.000000000000e+00 7.215377000000e+02 1.728540000000e+02 0.000000000000e+00 0.000000000000e+00 0.000000000000e+00 1.000000000000e+00 0.000000000000e+00
P2: 7.215377000000e+02 0.000000000000e+00 6.095593000000e+02 4.485728000000e+01 0.000000000000e+00 7.215377000000e+02 1.728540000000e+02 2.163791000000e-01 0.000000000000e+00 0.000000000000e+00 1.000000000000e+00 2.745884000000e-03
P3: 7.215377000000e+02 0.000000000000e+00 6.095593000000e+02 -3.395242000000e+02 0.000000000000e+00 7.215377000000e+02 1.728540000000e+02 2.199936000000e+00 0.000000000000e+00 0.000000000000e+00 1.000000000000e+00 2.729905000000e-03
R0_rect: 9.999239000000e-01 9.837760000000e-03 -7.445048000000e-03 -9.869795000000e-03 9.999421000000e-01 -4.278459000000e-03 7.402527000000e-03 4.351614000000e-03 9.999631000000e-01
Tr_velo_to_cam: 7.533745000000e-03 -9.999714000000e-01 -6.166020000000e-04 -4.069766000000e-03 1.480249000000e-02 7.280733000000e-04 -9.998902000000e-01 -7.631618000000e-02 9.998621000000e-01 7.523790000000e-03 1.480755000000e-02 -2.717806000000e-01
Tr_imu_to_velo: 9.999976000000e-01 7.553071000000e-04 -2.035826000000e-03 -8.086759000000e-01 -7.854027000000e-04 9.998898000000e-01 -1.482298000000e-02 3.195559000000e-01 2.024406000000e-03 1.482454000000e-02 9.998881000000e-01 -7.997231000000e-01
For extrinsic camera-LiDAR calibration and sensor fusion, I used the Autoware camera-LiDAR calibration tool. Now I want to use the KITTI calib format and use its files for road detection. I could not figure out how it is possible to use extrinsic matrix obtained by autoware in the kitti format. If you used this before, can you help me out how I should use rotation and transformation metrices for this purpose?

THREE.js: how to make a 4X4 matrix for translate, rotation and scale

I have these:
a translation:
[x1, y1, z1]
a 3X3 rotation matrix:
[ a11 a12 a13 ]
[ a21 a22 a23 ]
[ a31 a32 a33 ]
a scale:
[x2, y2, z2]
how to combine these into one 4X4 matrix, which is used for mesh.applyMatrix().
thanks.
Using your notation, construct your transform matrix like so:
matrix.set(
x2 * a11, y2* a12, z2 * a13, x1,
x2 * a21, y2* a22, z2 * a23, y1,
x2 * a31, y2* a32, z2 * a33, z1,
0, 0, 0, 1
);
three.js r.94

How to create a binary STL file containing more than one solid?

Including more than one solid in an ASCII STL file has been well described.
solid name1
facet normal N.x N.y N.z
outer loop
vertex V1.x V1.y V1.z
vertex V2.x V2.y V2.z
vertex V3.x V3.y V3.z
endloop
endfacet
facet …
…
endfacet
…
endsolid name1
solid name2
…
endsolid name2
…
However, the format described for a binary STL file does not say anything about including multiple solid objects.
80 Bytes string Header
4 Bytes uint32 Facets count
| 4 Bytes float N.x
| 4 Bytes float N.y
| 4 Bytes float N.z
| 4 Bytes float V1.x
| 4 Bytes float V1.y
| 4 Bytes float V1.z
facet1| 4 Bytes float V2.x
| 4 Bytes float V2.y
| 4 Bytes float V2.z
| 4 Bytes float V3.x
| 4 Bytes float V3.y
| 4 Bytes float V3.z
| 2 Bytes uint16 Attrib
facet2| …
facet3| …
…
In the binary format each facet has got an attribute (attrib). The facets whose attrib are the same will be considered part of the same solid.

Which flag to use for better quality with sws_scale?

/* values for the flags, the stuff on the command line is different */
#define SWS_FAST_BILINEAR 1
#define SWS_BILINEAR 2
#define SWS_BICUBIC 4
#define SWS_X 8
#define SWS_POINT 0x10
#define SWS_AREA 0x20
#define SWS_BICUBLIN 0x40
#define SWS_GAUSS 0x80
#define SWS_SINC 0x100
#define SWS_LANCZOS 0x200
#define SWS_SPLINE 0x400
Which one is better for image quality? What are differences? Are they all lossy?
I'm trying to convert RGB24 into YUV420P.
The RGB24 to YUV420 conversation itself is lossy. The scaling algorithm is probably used in downscaling the color information. I'd say the quality is:
point << bilinear < bicubic < lanczos/sinc/spline
I don't really know the others.
Under rare circumstances sinc is the ideal scaler and lossless, but those conditions are usually not met.
Are you also scaling the video? Otherwise I'd go for bicubic.

Unix - Sorting based on field position [duplicate]

This question already has answers here:
Unix - Sorting in shell script
(2 answers)
Closed 8 years ago.
I am trying to sort a file based on field position using the following command:
sort -d -k 2.42,44 -k 4.65,74
But when I check my output file whether it got sorted (sort -c) one of the lines is always out of order. The file to be sorted is given below:
000835NMSEFT 20140626095038403536
010835 577300053D0000000031860CZZBCCP01122000496 DA 2270000323 133052649999999999901121000358 DA 1235565067 201406301EG11388791 1953760980999999999 TN HCCLAIMPMT 40520140625PRREEP 21555 OXNARD STREET WOODLAND HILLS CA91367 BLEDI SOLUTIONS TE8002273983 IC URwww.anthem.com/provider/router PETWIN CITIES COMMUNITY HOS XX1396778197 FILE 57446 LOS ANGELES CA90074 TJ 752918765-0506330000-000 PN 050633-003 EY DCCP13305264991953760980 050633-003NMSINS 201406255004000270000323 0003230001 2014I 050633-003 00004 01505000323050633-003 00004
000835NMSEFT 20140626095038403536
010835 577300054D0000000002162CZZHCCP01122000496 DA 2270000323 133052649999999999901122000030 DA 1452500273 201406301EG11388792 1953760980999999999 TN HCCLAIMPMT 40520140625PRREEP 21555 OXNARD STREET WOODLAND HILLS CA91367 BLEDI SOLUTIONS TE8002273983 IC URwww.anthem.com/provider/router PESCRIPPS CLINIC XX1538297726 10666 N TORREY PINES RD S LA JOLLA CA92037 TJ 870737749-0000000000-000 BY DCCP13305264991953760980 870737749 NMSPRF 201406254004000270000323 0003230001 2014P 870737749-00300010 01405000323870737749-00300010
000835NMSEFT 20140626095038403536
010835 577300074D0000000002000CACHCCP01191179439 DA 3350209432 191179439099999999901121000358 DA 1459336554 201406301EG11388801 1953760980999999999 TN HCCLAIMPMT 40520140625PRALVORD UNIFIED SCHOOL DISTRICT 21555 OXNARD STREET WOODLAND HILLS CA91367 BLEDI SOLUTIONS TE8002273983 IC URwww.anthem.com/provider/router PEUSC CARE MEDICAL GROUP IN XX1902846306 50938 FILE LOS ANGELES CA90074 TJ 954540991-0000000000-000 EY DCCP19117943901953760980 954540991 NMSPRF 201406254022603350209432 2094320001 2014P 954540991 00045 01403209432954540991 00045
000835NMSEFT 20140626095038403536
010835 577300075D0000000021553CABHCCP01122000496 DA 2640001855 194147704099999999901121141819 DA 0009605886 201406301EG11388802 1953760980999999999 TN HCCLAIMPMT 40520140625PRHOOPA VALLEY TRIBAL COUNCIL 21555 OXNARD STREET WOODLAND HILLS CA91367 BLEDI SOLUTIONS TE8002273983 IC URwww.anthem.com/provider/router PEEUREKA FAMILY PRACTICE IN XX1114965761 2675 HARRIS ST EUREKA CA95503 TJ 941724607-0000000000-000 PN 941724 BY DCCP19414770401953760980 941724607 NMSPRF 201406254023202640001855 0018550001 2014P 941724607 00013 01405001855941724607 00013
000835NMSEFT 20140626095038403536
010835 577300076D0000000004819CABBCCP01122000496 DA 2640001855 194147704099999999901121141819 DA 990487159 201406301EG11388803 1953760980999999999 TN HCCLAIMPMT 40520140625PRHOOPA VALLEY TRIBAL COUNCIL 21555 OXNARD STREET WOODLAND HILLS CA91367 BLEDI SOLUTIONS TE8002273983 IC URwww.anthem.com/provider/router PEHUMBOLDT RADIOLOGY MED GR XX1326154196 PO BOX 6428 EUREKA CA95502 TJ 942188987-0000000000-000 EY DCCP19414770401953760980 942188987 NMSPRF 201406254023202640001855 0018550001 2014P 942188987 00004 01405001855942188987 00004
000835NMSEFT 20140626095038403536
010835 577300079D0000000010320CDAHCCP01122000496 DA 4000155328 133017499699999999901323070380 DA 485008267910 201406301EG11388804 1953760980999999999 TN HCCLAIMPMT 40520140625PRVIASAT, INC 21555 OXNARD STREET WOODLAND HILLS CA91367 BLEDI SOLUTIONS TE8002273983 IC URwww.anthem.com/provider/router PEWEST PACIFIC MEDICAL LABO XX1124050380 PO BOX 2339 SANTA FE SPGS CA90670 TJ 954391299-0000000000-000 BY DCCP13301749961953760980 954391299 NMSPRF 201406254025104000155328 1553280001 2014P 954391299 00025 01405155328954391299 00025
Two problems. The number after the decimal is a character position within the field (not from the beginning of the line). And you need to repeat the field number after the commas. So:
sort -k 2.25,2.27 -k 4,4

Resources