# Left/right cameras appear to be reversed

Source: https://forum.modalai.com/topic/2622/left-right-cameras-appear-to-be-reversed
Category: General Questions (https://forum.modalai.com/category/2/general-questions)
Posted: 2023-09-05 15:00:46 UTC by afdrus
Replies: 2 · Views: 711

## afdrus · 2023-09-05 15:00:46 UTC

Hello everyone,

I am trying to setup a drone with voxl2 and dual stereo on the front of the drone and on the side of the drone. When I try to calibrate the stereo cameras on the side of the drone however I find the following error:
```
Calibrating Extrinsics
4 frames will be processed
R
[0.9999053202420889, 0.01070168208593433, -0.008650118617524936;
 -0.0103011892164794, 0.9989299071531981, 0.04508798172051345;
 0.009123379433737689, -0.04499460629269533, 0.9989455687635205]
T
[0.0807117010366965;
 0.0001046958105907691;
 0.003971263355485772]
Re-projection error reported by stereoCalibrate: 0.377810
Detected horizontal stereo pair
Distance between cameras: -0.0807
Extrinsics Calibration Failed
left/right cameras appear to be reversed
```
How can I solve the issue? I copied the cable management from the sentinel configuration so I doubt that it is a HW issue

## Reply by James Strawson (ModalAI staff) · 2023-09-05 19:07:17 UTC

@afdrus 

in /etc/modalai/voxl-camera-server.conf you will see the following segment for the stereo pairs,

```json
			"type":	"ov7251",
			"name":	"stereo",
			"enabled":	true,
			"camera_id":	1,
			"camera_id_second":	2,
```

If you swap the ID numbers for camera_id and camera_id_second it will reverse the left and right cameras in the stereo stream.

Best,
James

## Reply by afdrus · 2023-09-06 07:32:12 UTC (in reply to James Strawson)

@James-Strawson Thanks for the reply! Now I am facing a new issue though, after I swapped the camera ids the calibration of the extrinsics is asking me to move the checkboard in only three locations instead of four, as a result the reprojection error keeps being high, is this a bug?

Result of the new extrinsics:

```
Calibrating Extrinsics
4 frames will be processed
R
[-0.2178154138909582, 0.5612314553199155, 0.7984833742984259;
 0.6516188344157804, -0.5254512170251917, 0.5470776116433248;
 0.7266012249550162, 0.6394687420712871, -0.2512576124371861]
T
[-0.5933205685053882;
 -0.3699353785761611;
 0.8991646361380521]
Re-projection error reported by stereoCalibrate: 71.628572
Detected horizontal stereo pair
Distance between cameras: 0.5933
Extrinsics Calibration Failed
exceeded allowable max reprojection error:  0.5
```
voxl-camer-server with ids already swapped, the stereo in question is stereo_rear, 
```
{
	"version":	0.1,
	"cameras":	[{
			"name":	"tracking",
			"enabled":	true,
			"frame_rate":	30,
			"type":	"ov7251",
			"camera_id":	2,
			"ae_desired_msv":	60,
			"ae_filter_alpha":	0.600000023841858,
			"ae_ignore_fraction":	0.20000000298023224,
			"ae_slope":	0.05000000074505806,
			"ae_exposure_period":	1,
			"ae_gain_period":	1
		}, {
			"name":	"hires",
			"enabled":	true,
			"frame_rate":	30,
			"type":	"imx214",
			"camera_id":	3,
			"preview_width":	640,
			"preview_height":	480,
			"snapshot_width":	3840,
			"snapshot_height":	2160
		}, {
			"name":	"stereo_front",
			"enabled":	true,
			"frame_rate":	30,
			"type":	"ov7251",
			"camera_id":	0,
			"camera_id_second":	1,
			"independent_exposure":	false,
			"ae_desired_msv":	60,
			"ae_filter_alpha":	0.600000023841858,
			"ae_ignore_fraction":	0.20000000298023224,
			"ae_slope":	0.05000000074505806,
			"ae_exposure_period":	1,
			"ae_gain_period":	1
		}, {
			"name":	"stereo_rear",
			"enabled":	true,
			"frame_rate":	30,
			"type":	"ov7251",
			"camera_id":	4,
			"camera_id_second":	5,
			"independent_exposure":	false,
			"ae_desired_msv":	60,
			"ae_filter_alpha":	0.600000023841858,
			"ae_ignore_fraction":	0.20000000298023224,
			"ae_slope":	0.05000000074505806,
			"ae_exposure_period":	1,
			"ae_gain_period":	1
		}]
}
```
