コード例 #1
0
 /// <summary>
 /// computes various useful camera (sensor/lens) characteristics using the computed camera calibration matrix, image frame resolution in pixels and the physical aperture size
 /// </summary>
 /// <param name="imgWidth">Image width in pixels</param>
 /// <param name="imgHeight">Image height in pixels</param>
 /// <param name="apertureWidth">Aperture width in realworld units (optional input parameter). Set it to 0 if not used</param>
 /// <param name="apertureHeight">Aperture width in realworld units (optional input parameter). Set it to 0 if not used</param>
 /// <param name="fovx">Field of view angle in x direction in degrees</param>
 /// <param name="fovy">Field of view angle in y direction in degrees </param>
 /// <param name="focalLength">Focal length in realworld units </param>
 /// <param name="principalPoint">The principal point in realworld units </param>
 /// <param name="pixelAspectRatio">The pixel aspect ratio ~ fy/f</param>
 public void GetIntrinsicMatrixValues(
     int imgWidth,
     int imgHeight,
     double apertureWidth,
     double apertureHeight,
     out double fovx,
     out double fovy,
     out double focalLength,
     out MCvPoint2D64f principalPoint,
     out double pixelAspectRatio)
 {
     fovx             = 0;
     fovy             = 0;
     focalLength      = 0;
     principalPoint   = new MCvPoint2D64f();
     pixelAspectRatio = 0;
     CvInvoke.CalibrationMatrixValues(_intrinsicMatrix, new Size(imgWidth, imgHeight), apertureWidth, apertureHeight, ref fovx, ref fovy, ref focalLength, ref principalPoint, ref pixelAspectRatio);
 }