@@ -587,6 +587,23 @@ static PyObject *color_image_get_exposure_usec(PyObject *self, PyObject *args) {
587
587
return Py_BuildValue (" K" , exposure_usec);
588
588
}
589
589
590
+ static PyObject *color_image_get_iso_speed (PyObject *self, PyObject *args) {
591
+ k4a_capture_t *capture_handle;
592
+ PyObject *capsule;
593
+ uint32_t iso_speed = 0 ;
594
+ PyArg_ParseTuple (args, " O" , &capsule);
595
+ capture_handle = (k4a_capture_t *)PyCapsule_GetPointer (capsule, CAPSULE_CAPTURE_NAME);
596
+
597
+ k4a_image_t image = k4a_capture_get_color_image (*capture_handle);
598
+ if (image == NULL ) {
599
+ fprintf (stderr, " Color image missed" );
600
+ return Py_BuildValue (" I" , iso_speed);
601
+ }
602
+ iso_speed = k4a_image_get_iso_speed (image);
603
+ k4a_image_release (image);
604
+ return Py_BuildValue (" I" , iso_speed);
605
+ }
606
+
590
607
static PyObject *color_image_get_white_balance (PyObject *self, PyObject *args) {
591
608
k4a_capture_t *capture_handle;
592
609
PyObject *capsule;
@@ -1090,6 +1107,29 @@ static PyObject *calibration_get_intrinsics(PyObject *self, PyObject *args) {
1090
1107
return Py_BuildValue (" N" , intrinsics);
1091
1108
}
1092
1109
1110
+ static PyObject *calibration_get_extrinsics (PyObject *self, PyObject *args) {
1111
+ k4a_calibration_t *calibration_handle;
1112
+ PyObject *capsule;
1113
+ int thread_safe;
1114
+ k4a_calibration_type_t source_camera;
1115
+ k4a_calibration_type_t target_camera;
1116
+ PyThreadState *thread_state;
1117
+
1118
+ PyArg_ParseTuple (args, " OpII" , &capsule, &thread_safe, &source_camera, &target_camera);
1119
+ calibration_handle = (k4a_calibration_t *)PyCapsule_GetPointer (capsule, CAPSULE_CALIBRATION_NAME);
1120
+
1121
+ thread_state = _gil_release (thread_safe);
1122
+
1123
+ k4a_calibration_extrinsics_t calib = calibration_handle->extrinsics [source_camera][target_camera];
1124
+
1125
+ _gil_restore (thread_state);
1126
+
1127
+ PyObject *rotation = _array_to_list (calib.rotation , 9 );
1128
+ PyObject *translation = _array_to_list (calib.translation , 3 );
1129
+
1130
+ return Py_BuildValue (" NN" , rotation, translation);
1131
+ }
1132
+
1093
1133
static PyObject *playback_open (PyObject *self, PyObject *args) {
1094
1134
int thread_safe;
1095
1135
PyThreadState *thread_state;
@@ -1483,6 +1523,8 @@ static PyMethodDef Pyk4aMethods[] = {
1483
1523
" Transform a 3D point of a source coordinate system into a 2D pixel coordinate of the target camera" },
1484
1524
{" calibration_get_intrinsics" , calibration_get_intrinsics, METH_VARARGS,
1485
1525
" Gets intrinsic parameters from calibration" },
1526
+ {" calibration_get_extrinsics" , calibration_get_extrinsics, METH_VARARGS,
1527
+ " Gets extrinsic parameters from calibration" },
1486
1528
{" playback_open" , playback_open, METH_VARARGS, " Open file for playback" },
1487
1529
{" playback_close" , playback_close, METH_VARARGS, " Close opened playback" },
1488
1530
{" playback_get_recording_length_usec" , playback_get_recording_length_usec, METH_VARARGS, " Return recording length" },
@@ -1499,6 +1541,7 @@ static PyMethodDef Pyk4aMethods[] = {
1499
1541
{" playback_get_next_imu_sample" , playback_get_next_imu_sample, METH_VARARGS, " Get next imu sample from playback" },
1500
1542
{" color_image_get_exposure_usec" , color_image_get_exposure_usec, METH_VARARGS,
1501
1543
" Get color image exposure in microseconds" },
1544
+ {" color_image_get_iso_speed" , color_image_get_iso_speed, METH_VARARGS, " Get color image ISO speed" },
1502
1545
{" color_image_get_white_balance" , color_image_get_white_balance, METH_VARARGS, " Get color image white balance" },
1503
1546
{" record_create" , record_create, METH_VARARGS, " Opens a new recording file for writing" },
1504
1547
{" record_close" , record_close, METH_VARARGS, " Opens a new recording file for writing" },
0 commit comments