I have an API call that will return a JSON body similar to this:
{
"__type": "Aldis.Models.v4.Info.CameraStatusModel, Aldis.Models",
"ActiveCamera": [
{
"RectilinearIR": {
"CalibrationMask": {
"Length": 0,
"Width": 0,
"Id": "3fc388275b724e82819cf44603db69c3",
"Polygon": []
},
"CameraMasks": {
"OcclusionMasks": [],
"RoadMasks": [],
"ZoneMasks": []
},
"CompassHeading": 0,
"ExtrinsicCalibration": {
"HeightFeet": 16
},
"IntrinsicCalibration": {
"FocalLengthX": 428,
"FocalLengthY": 480,
"ImageCenterX": 0.5,
"ImageCenterY": 0.5,
"ImageHeight": 480,
"ImageWidth": 720,
"RadialDistortion1": 0,
"RadialDistortion2": 0,
"TangentialDistortion1": 0,
"TangentialDistortion2": 0,
"Channels": 3,
"Depth": 8,
"Height": 480,
"MaxJpegSize": 140000,
"Width": 720
},
"IsConfigured": true,
"MACAddress": "AC:CC:8E:23:35:86",
"Make": "AXIS",
"Name": "SW FLIR"
}
},
{
"Fisheye": {
"CameraMasks": {
"OcclusionMasks": [],
"RoadMasks": [],
"ZoneMasks": []
},
"CompassHeading": 0,
"ExtrinsicCalibration": {
"HeightFeet": 16
},
"IntrinsicCalibration": {
"Diameter": 0.85625,
"ImageCenterX": 0.5109375,
"ImageCenterY": 0.50625,
"ImageHeight": 960,
"ImageWidth": 1280,
"ViewAngleDegrees": 185,
"Channels": 3,
"Depth": 8,
"Height": 960,
"MaxJpegSize": 140000,
"Width": 1280
},
"IsConfigured": true,
"MACAddress": "00:30:53:1d:2c:22",
"Make": "Basler",
"Name": "SW Bell"
}
}
],
"MissingCameras": [],
"UnknownCameras": []
}
I want to write a test that checks that the details for each camera. As you can see from the return body, if the camera is a RectilinearIR, the IntrinsicCalibration details are different from those for the Fisheye camera.
As I go through each object in the ActiveCamera array, how do I determine if I have a RectilinearIR camera or if I have a Fisheye?