1

I'm trying to access the camera intrinsics parameters using media foundation \ directshow API's, like focal length, principal point and distortion coefficients.

I saw that focal length can be queried via ICameraControl, but for all the other parameters I can't find a way.

Is there a general way to do it in Media foundation\Directshow API's?

Eldar
  • 149
  • 2
  • 12

1 Answers1

0

MediaCapture on Windows 10 can get intrinsics information from some cameras. Intel RealSense, Windows Hello, and Kinect should be supported.

Also, intrinsics are available from the MediaFrameSource, see MediaCapture.FrameSources.

This UWP sample can be used as a reference. You shouldn't have any problems with C# either.

alekseyk
  • 133
  • 9
  • yeah, I found UWP API's, was wondering if there's something in Win32. – Eldar May 11 '17 at 06:39
  • @Eldar: UWP is supposedly obtaining that through Media Foundation. When intrinsics are available, you'd get the respective attributes with the captured video feed. I don't think you can access them with DirectShow though. – Roman R. May 11 '17 at 09:14
  • @Eldar, might be an off-topic, but you can use WinRT APIs from Win32 apps. – alekseyk May 11 '17 at 15:44
  • 1
    If you want to use MF APIs, you can get the binary blob from the IMFSample (it's MFStreamExtension_PinholeCameraIntrinsics defined in the mfapi.h), and then cast it to the MFPinholeCameraIntrinsics structure (mfapi.h). Devproxy's GetOutputStreamAttributes() result should have it too. I might be wrong, but the binary format for intrinsics is not standardized yet. – alekseyk May 11 '17 at 15:52