namespace RobotNet10.Shared.Sensor; /// /// CameraInfo message (sensor_msgs/CameraInfo) /// This message defines meta information for a camera /// public struct CameraInfo { /// /// Header with timestamp and frame ID /// public Header Header { get; set; } /// /// Image height (rows) /// public uint Height { get; set; } /// /// Image width (columns) /// public uint Width { get; set; } /// /// Distortion model constants /// public const string DistortionModelPlumbBob = "plumb_bob"; public const string DistortionModelRationalPolynomial = "rational_polynomial"; /// /// The distortion model used /// public string DistortionModel { get; set; } /// /// Intrinsic camera matrix for the raw (distorted) images. /// [fx 0 cx] /// K = [ 0 fy cy] /// [ 0 0 1] /// Projects 3D points in the camera coordinate frame to 2D pixel /// coordinates using the focal lengths (fx, fy) and principal point /// (cx, cy). /// public double[] K { get; set; } /// /// Size of intrinsic camera matrix (3x3 = 9 elements) /// public const int KSize = 9; /// /// Rectification matrix (stereo cameras only) /// A rotation matrix aligning the camera coordinate system to the ideal /// stereo image plane so that epipolar lines in both stereo images are /// parallel. /// public double[] R { get; set; } /// /// Size of rectification matrix (3x3 = 9 elements) /// public const int RSize = 9; /// /// Projection/camera matrix /// [fx' 0 cx' Tx] /// P = [ 0 fy' cy' Ty] /// [ 0 0 1 0] /// By convention, this matrix specifies the intrinsic (camera) matrix /// of the processed (rectified) image. That is, the left 3x3 portion /// is the normal camera intrinsic matrix for the rectified image. /// public double[] P { get; set; } /// /// Size of projection matrix (3x4 = 12 elements) /// public const int PSize = 12; /// /// The distortion parameters, size depending on the distortion model. /// For "plumb_bob", the 5 parameters are: (k1, k2, t1, t2, k3). /// public double[] D { get; set; } /// /// Region of interest (subwindow of full camera resolution) /// public RegionOfInterest Roi { get; set; } /// /// Default constructor /// public CameraInfo() { Header = new Header(); Height = 0; Width = 0; DistortionModel = DistortionModelPlumbBob; K = new double[KSize]; R = new double[RSize]; P = new double[PSize]; D = []; Roi = new RegionOfInterest(); } } /// /// RegionOfInterest message (sensor_msgs/RegionOfInterest) /// This message is used to specify a region of interest within an image /// public struct RegionOfInterest { /// /// Leftmost pixel of the ROI /// public uint XOffset { get; set; } /// /// Topmost pixel of the ROI /// public uint YOffset { get; set; } /// /// Height of ROI /// public uint Height { get; set; } /// /// Width of ROI /// public uint Width { get; set; } /// /// True if a distinct rectified ROI should be calculated from the "raw" /// ROI in this message. Typically this should be False on the "raw" image /// and True on the "rectified" image. /// public bool DoRectify { get; set; } /// /// Default constructor /// public RegionOfInterest() { XOffset = 0; YOffset = 0; Height = 0; Width = 0; DoRectify = false; } }