示例#1
0
        /// <summary>
        /// Initialize a Kinect Fusion cameraPoseFinder.
        /// A Kinect camera is required to be connected.
        /// </summary>
        /// <param name="cameraPoseFinderParameters">
        /// The parameters to define the number of poses and feature sample locations the camera pose finder uses.
        /// </param>
        /// <returns>The CameraPoseFinder instance.</returns>
        /// <exception cref="ArgumentNullException">
        /// Thrown when the <paramref name="cameraPoseFinderParameters"/> parameter is null.
        /// </exception>
        /// <exception cref="ArgumentException">
        /// Thrown when the <paramref name="cameraPoseFinderParameters"/> parameter's
        /// <c>featureSampleLocationsPerFrameCount</c>, <c>maxPoseHistoryCount</c> member is not a greater than 0,
        /// or the <c>featureSampleLocationsPerFrameCount</c> member is greater than 1000.
        /// </exception>
        /// <exception cref="OutOfMemoryException">
        /// Thrown when the memory required for the camera pose finder processing could not be
        /// allocated.
        /// </exception>
        /// <exception cref="InvalidOperationException">
        /// Thrown when the Kinect Runtime could not be accessed, the Kinect device is not
        /// connected or the call failed for an unknown reason.
        /// </exception>
        public static CameraPoseFinder FusionCreateCameraPoseFinder(
            CameraPoseFinderParameters cameraPoseFinderParameters)
        {
            if (null == cameraPoseFinderParameters)
            {
                throw new ArgumentNullException("cameraPoseFinderParameters");
            }

            INuiFusionCameraPoseFinder poseFinder = null;

            ExceptionHelper.ThrowIfFailed(NativeMethods.NuiFusionCreateCameraPoseFinder2(
                                              cameraPoseFinderParameters,
                                              IntPtr.Zero,
                                              out poseFinder));

            return(new CameraPoseFinder(poseFinder));
        }
示例#2
0
        /// <summary>
        /// Initialize a Kinect Fusion cameraPoseFinder, with random number generator seed for feature
        /// locations and feature thresholds.
        /// </summary>
        /// <param name="cameraPoseFinderParameters">
        /// The parameters to define the number of poses and feature sample locations the camera pose finder uses.
        /// </param>
        /// <param name="randomFeatureLocationAndThresholdSeed">
        /// A seed to initialize the random number generator for feature locations and feature thresholds.
        /// </param>
        /// <returns>The CameraPoseFinder instance.</returns>
        /// <exception cref="ArgumentNullException">
        /// Thrown when the <paramref name="cameraPoseFinderParameters"/> parameter is null.
        /// </exception>
        /// <exception cref="ArgumentException">
        /// Thrown when the <paramref name="cameraPoseFinderParameters"/> parameter's
        /// <c>featureSampleLocationsPerFrameCount</c>, <c>maxPoseHistoryCount</c> member is not a greater than 0,
        /// or a maximum of 10,000,000, the <c>featureSampleLocationsPerFrameCount</c> member is greater than 1000,
        /// or the <paramref name="randomFeatureLocationAndThresholdSeed"/> parameter is negative.
        /// </exception>
        /// <exception cref="OutOfMemoryException">
        /// Thrown when the memory required for the camera pose finder processing could not be
        /// allocated.
        /// </exception>
        /// <exception cref="InvalidOperationException">
        /// Thrown when the Kinect Runtime could not be accessed, the Kinect device is not
        /// connected or the call failed for an unknown reason.
        /// </exception>
        public static CameraPoseFinder FusionCreateCameraPoseFinder(
            CameraPoseFinderParameters cameraPoseFinderParameters,
            int randomFeatureLocationAndThresholdSeed)
        {
            if (null == cameraPoseFinderParameters)
            {
                throw new ArgumentNullException("cameraPoseFinderParameters");
            }

            uint seed = ExceptionHelper.CastAndThrowIfOutOfUintRange(randomFeatureLocationAndThresholdSeed);

            INuiFusionCameraPoseFinder poseFinder = null;

            ExceptionHelper.ThrowIfFailed(NativeMethods.NuiFusionCreateCameraPoseFinder(
                                              cameraPoseFinderParameters,
                                              ref seed,
                                              out poseFinder));

            return(new CameraPoseFinder(poseFinder));
        }
示例#3
0
 /// <summary>
 /// Initializes a new instance of the CameraPoseFinder class.
 /// Default constructor used to initialize with the native CameraPoseFinder object.
 /// </summary>
 /// <param name="poseFinder">
 /// The native CameraPoseFinder object to be encapsulated.
 /// </param>
 internal CameraPoseFinder(INuiFusionCameraPoseFinder poseFinder)
 {
     this.cameraPoseFinder = poseFinder;
 }
示例#4
0
 /// <summary>
 /// Initializes a new instance of the CameraPoseFinder class.
 /// Default constructor used to initialize with the native CameraPoseFinder object.
 /// </summary>
 /// <param name="poseFinder">
 /// The native CameraPoseFinder object to be encapsulated.
 /// </param>
 internal CameraPoseFinder(INuiFusionCameraPoseFinder poseFinder)
 {
     this.cameraPoseFinder = poseFinder;
 }