Example #1
0
 /**
     @brief Access the stream descriptor by the stream type.
     @param[in] type		The stream type.
     @return The stream descriptor instance.
 */
 public StreamDesc this[PXCMCapture.StreamType type]
 {
     get
     {
         if (type == PXCMCapture.StreamType.STREAM_TYPE_COLOR) return color;
         if (type == PXCMCapture.StreamType.STREAM_TYPE_DEPTH) return depth;
         if (type == PXCMCapture.StreamType.STREAM_TYPE_IR) return ir;
         if (type == PXCMCapture.StreamType.STREAM_TYPE_LEFT) return left;
         if (type == PXCMCapture.StreamType.STREAM_TYPE_RIGHT) return right;
         if (type == PXCMCapture.StreamTypeFromIndex(5)) return reserved1;
         if (type == PXCMCapture.StreamTypeFromIndex(6)) return reserved2;
         return reserved3;
     }
     set
     {
         if (type == PXCMCapture.StreamType.STREAM_TYPE_COLOR) color = value;
         if (type == PXCMCapture.StreamType.STREAM_TYPE_DEPTH) depth = value;
         if (type == PXCMCapture.StreamType.STREAM_TYPE_IR) ir = value;
         if (type == PXCMCapture.StreamType.STREAM_TYPE_LEFT) left = value;
         if (type == PXCMCapture.StreamType.STREAM_TYPE_RIGHT) right = value;
         if (type == PXCMCapture.StreamTypeFromIndex(5)) reserved1 = value;
         if (type == PXCMCapture.StreamTypeFromIndex(6)) reserved2 = value;
         if (type == PXCMCapture.StreamTypeFromIndex(7)) reserved3 = value;
     }
 }
Example #2
0
 internal static extern pxcmStatus PXCMCapture_Device_SetPropertyAuto(IntPtr device, PXCMCapture.Device.Property pty, [MarshalAs(UnmanagedType.Bool)] Boolean ifauto);
Example #3
0
 internal static PropertyInfo QueryPropertyInfoINT(IntPtr device, PXCMCapture.Device.Property label)
 {
     PropertyInfo info = new PropertyInfo();
     PXCMCapture_Device_QueryPropertyInfo(device, label, info);
     return info;
 }
Example #4
0
 internal static extern pxcmStatus PXCMCapture_Device_QueryProperty(IntPtr device, PXCMCapture.Device.Property label, out Single value);
 internal pxcmStatus ExtractPlanesINT(IntPtr sp, PXCMCapture.Sample sample, Single minPlaneArea, Int32 maxPlaneNumber, Single[] pPlaneEq, byte[] pPlaneIndexImg)
 {
     return PXCMScenePerception_ExtractPlanes(sp, sample, minPlaneArea, maxPlaneNumber, pPlaneEq, pPlaneIndexImg);
 }
 internal static extern Single PXCMScenePerception_CheckSceneQuality(IntPtr sp, PXCMCapture.Sample sample);
Example #7
0
 /** 
 @brief Set the sample stream type.
 @param[in] streamType    The sample stream type.
 */
 public void SetStreamType(PXCMCapture.StreamType type)
 {
     PXCMImage_SetStreamType(instance, type);
 }
        /**
            @brief	Explicitly request to stream the specified raw stream. If specified more than one stream, 
            SenseManager will synchronize these streams. If called multiple times, the function treats each
            stream request as independent (unaligned). The stream identifier is PXCMCapture.CUID+n.
            @param[in] type					The stream type.
            @param[in] width				stream width.
            @param[in] height				stream height.
            @param[in] fps					stream frame rate.
            @return PXC_STATUS_NO_ERROR		Successful execution.
        */
        public pxcmStatus EnableStream(PXCMCapture.StreamType type, Int32 width, Int32 height, Single fps)
        {

            PXCMVideoModule.DataDesc ddesc = new PXCMVideoModule.DataDesc();
            ddesc.deviceInfo.streams = type;

            PXCMVideoModule.StreamDesc sdesc = ddesc.streams[type];
            sdesc.sizeMin.width = width;
            sdesc.sizeMax.width = width;
            sdesc.sizeMin.height = height;
            sdesc.sizeMax.height = height;
            sdesc.frameRate.min = fps;
            sdesc.frameRate.max = fps;
            return EnableStreams(ddesc);
        }
 internal static extern void PXCMCaptureManager_FilterByDeviceInfo(IntPtr cutil, PXCMCapture.DeviceInfo dinfo);
Example #10
0
 public static String ToString(this PXCMCapture.DeviceModel model)
 {
     return(PXCMCapture.DeviceModelToString(model));
 }
Example #11
0
 public static Int32 ToIndex(this PXCMCapture.StreamType type)
 {
     return(PXCMCapture.StreamTypeToIndex(type));
 }
Example #12
0
 public static String ToString(this PXCMCapture.StreamType stream)
 {
     return(PXCMCapture.StreamTypeToString(stream));
 }
        /** 
            @brief: Allows user to check whether the input Stream is suitable 
            for starting Scene Perception or not. We recommend using this 
            function when ScenePerceptin module is paused. User can pause 
            Scene Perception module using PXCMSenseManager.PauseScenePerception().
            This function should only be used as initializer to help user to determine 
            When to start or reset scene Perception. 
			
            @param[in] PXCMCapture.Sample: Input stream sample required by 
            Scene Perception module.

            @returns: Returns a value between 0.0 and 1.0 where: 
                    1.0 - represents ideal Scene for starting Scene Perception.
                    0.0 - represents unsuitable Scene for 
                          starting Scene Perception.
        */
        public Single CheckSceneQuality(PXCMCapture.Sample sample)
        {
            return PXCMScenePerception_CheckSceneQuality(instance, sample);
        }
        /**
			@brief: Allows user to integrate specified stream from supplied pose in to 
			the reconstructed volume.

			@param[in] sample: Input stream sample required by Scene Perception module.
			Obtained using PXCMSenseManager.QueryScenePerceptionSample().

			@param[in] pose: Estimated Pose for the supplied input stream.
			Array of 12 pxcF32 that stores the camera pose
			user wishes to set in row-major order. Camera pose is specified in a 
			3 by 4 matrix [R | T] = [Rotation Matrix | Translation Vector]
			where R = [ r11 r12 r13 ]
			[ r21 r22 r23 ] 
			[ r31 r32 r33 ]
			T = [ tx  ty  tz  ]
			Pose Array Layout = [r11 r12 r13 tx r21 r22 r23 ty r31 r32 r33 tz]
			Translation vector is in meters.

			@returns: PXCM_STATUS_NO_ERROR, If the function succeeds.
			Otherwise error code will be returned.
		*/
        public pxcmStatus DoReconstruction(PXCMCapture.Sample sample, Single[] pose)
        {
            return PXCMScenePerception_DoReconstruction(instance, sample, pose);
        }
        /**
            @brief: Allows user to get information regarding the planar 
            surfaces in the scene.

            @param[in] sample: Input stream sample required by Scene Perception module.

            @param[in] minPlaneArea: Minimum plane area to be detected in physical 
            dimension (m^2). This parameter refers to the physical size of the
            frontal planar surface at 1 meter to 3 meter from the camera. It controls 
            the threshold for the number of planes to be returned. Setting it to a
            smaller value makes the function to return smaller planes as well.
            E.g 0.213X0.213 m^2. The maximum acceptable value is 16.

            @param [in] maxPlaneNumber: Maximum number of planes that user wishes
            to detect, It should also match Number of rows of the equation 
            array pPlaneEq

            @param[out] pPlaneEq: Pre-allocated float array for storing the 
            plane equations detected by the function. Each row contains the 
            coefficients {a,b,c,w} of the detected plane, Hence the number of 
            rows are equal to maxPlaneNumber. a, b, c are co-efficients of 
            normalized plane equation and w is in meters.
            E.g. Row 0 of pPlaneEq will contain the plane equation: ax+by+cz+w
            in the form	pPlaneEq[0][0] to pPlaneEq[0][3] = {a,b,c,w}. Similarly
            rest of the rows will provide the equations for the remaining 
            planes. Rows for which planes are not detected will have all values 0.
			
            @param[out] pPlaneIndexImg: Pre-allocated array of (320X240) to store plane 
            ids. On Success each index will have one of the following values 
                - 0: If the pixel is not part of any detected planes 
                - 1: If the pixel is part of the first plane detected
                - 2: If the pixel is part of the second plane is detected
                and so on.

            @returns: On success PXCM_STATUS_NO_ERROR,			
            Otherwise error code will be returned on failure
        */

        public pxcmStatus ExtractPlanes(PXCMCapture.Sample sample, Single minPlaneArea, Int32 maxPlaneNumber, out Single[,] pPlaneEq, 
             out byte[] pPlaneIndexImg)
        {
            pPlaneIndexImg = new byte[320*240];
            pPlaneEq = new Single[maxPlaneNumber, 4];
            Single[] pPlaneEq1D = new Single[maxPlaneNumber * 4];
            pxcmStatus status = ExtractPlanesINT(instance, sample, minPlaneArea, maxPlaneNumber, pPlaneEq1D, pPlaneIndexImg);
            for (int i = 0; i < maxPlaneNumber; i++)
                for (int j=0; j<4; j++)
                    pPlaneEq[i,j] = pPlaneEq1D[i*4+j];
            return status;
        }
Example #16
0
 /**
  *  @brief Access the stream descriptor by the stream type.
  *  @param[in] type		The stream type.
  *  @return The stream descriptor instance.
  */
 public StreamDesc this[PXCMCapture.StreamType type]
 {
     get
     {
         if (type == PXCMCapture.StreamType.STREAM_TYPE_COLOR)
         {
             return(color);
         }
         if (type == PXCMCapture.StreamType.STREAM_TYPE_DEPTH)
         {
             return(depth);
         }
         if (type == PXCMCapture.StreamType.STREAM_TYPE_IR)
         {
             return(ir);
         }
         if (type == PXCMCapture.StreamType.STREAM_TYPE_LEFT)
         {
             return(left);
         }
         if (type == PXCMCapture.StreamType.STREAM_TYPE_RIGHT)
         {
             return(right);
         }
         if (type == PXCMCapture.StreamTypeFromIndex(5))
         {
             return(reserved1);
         }
         if (type == PXCMCapture.StreamTypeFromIndex(6))
         {
             return(reserved2);
         }
         return(reserved3);
     }
     set
     {
         if (type == PXCMCapture.StreamType.STREAM_TYPE_COLOR)
         {
             color = value;
         }
         if (type == PXCMCapture.StreamType.STREAM_TYPE_DEPTH)
         {
             depth = value;
         }
         if (type == PXCMCapture.StreamType.STREAM_TYPE_IR)
         {
             ir = value;
         }
         if (type == PXCMCapture.StreamType.STREAM_TYPE_LEFT)
         {
             left = value;
         }
         if (type == PXCMCapture.StreamType.STREAM_TYPE_RIGHT)
         {
             right = value;
         }
         if (type == PXCMCapture.StreamTypeFromIndex(5))
         {
             reserved1 = value;
         }
         if (type == PXCMCapture.StreamTypeFromIndex(6))
         {
             reserved2 = value;
         }
         if (type == PXCMCapture.StreamTypeFromIndex(7))
         {
             reserved3 = value;
         }
     }
 }
 internal static extern void PXCMCaptureManager_FilterByStreamProfiles(IntPtr cutil, PXCMCapture.Device.StreamProfileSet profiles);
 internal static extern void PXCMCaptureManager_QueryImageSize(IntPtr putil, PXCMCapture.StreamType type, ref PXCMSizeI32 size);
Example #19
0
 internal static extern pxcmStatus PXCMVideoModule_ProcessImageAsync(IntPtr module, PXCMCapture.Sample sample, out IntPtr sp);
 /**
     @brief	Return the stream resolution of the specified stream type.
     @param[in]	type		The stream type.
     @return the stream resolution.
 */
 public PXCMSizeI32 QueryImageSize(PXCMCapture.StreamType type)
 {
     PXCMSizeI32 size = new PXCMSizeI32();
     PXCMCaptureManager_QueryImageSize(instance, type, ref size);
     return size;
 }
Example #21
0
 internal static extern void PXCMImage_SetStreamType(IntPtr image, PXCMCapture.StreamType type);
 internal static extern void PXCMCaptureManager_SetMask(IntPtr cutil, PXCMCapture.StreamType types);
 internal static extern pxcmStatus PXCMScenePerception_ExtractPlanes(IntPtr sp, PXCMCapture.Sample sample, Single minPlaneArea, Int32 maxPlaneNumber, Single[] pEquations, byte[] pIndexImage);
 private pxcmStatus OnSetupStreams(IntPtr device, PXCMCapture.StreamType types)
 {
     PXCMCapture.Device device2 = new PXCMCapture.Device(device, false);
     return handler.onSetupStreams(device2, types);
 }
 internal static extern pxcmStatus PXCMScenePerception_DoReconstruction(IntPtr sp, PXCMCapture.Sample sample, Single[] pose);
Example #26
0
 /** 
     @brief Import the preview sample content into the photo instance.
     @param[in]  sample				The PXCMCapture.Sample instance from the SenseManager QuerySample().
     @return PXC_STATUS_NO_ERROR     Successful execution.
 */
 public pxcmStatus ImportFromPreviewSample(PXCMCapture.Sample sample) {
     return PXCMPhoto_ImportFromPreviewSample(instance, sample);
 }
Example #27
0
 private static extern pxcmStatus PXCMCapture_Device_QueryPropertyInfo(IntPtr device, PXCMCapture.Device.Property label, [Out] PropertyInfo info);
Example #28
0
	/**
	@brief Query camera calibration and transformation data for a sensor according to user defined options.
	@param[in]  streamType      The stream type which is produced by the sensor.
	@param[in]  options         The options that selects specific calibration and transformation data which is produced by the sensor.
	@param[out] calibration     The intrinsics calibration parameters of the sensor.
	@param[out] transformation  The extrinsics transformation parameters from the sensor to the camera coordinate system origin.
	@return PXCM_STATUS_NO_ERROR Successful execution.
	*/
        public pxcmStatus QueryStreamProjectionParametersEx(PXCMCapture.StreamType streamType, PXCMCapture.Device.StreamOption options, out StreamCalibration calibration, out StreamTransform transformation)
        {
            calibration = new StreamCalibration();
            transformation = new StreamTransform();
            return PXCMCalibration_QueryStreamProjectionParametersEx(instance, streamType, options, calibration, transformation);
        }
Example #29
0
 internal static extern pxcmStatus PXCMCapture_Device_QueryPropertyAuto(IntPtr device, PXCMCapture.Device.Property label, out Boolean ifauto);
Example #30
0
 internal static extern pxcmStatus PXCMPhoto_ImportFromPreviewSample(IntPtr photo, PXCMCapture.Sample sample);
Example #31
0
 internal static extern pxcmStatus PXCMCapture_Device_SetProperty(IntPtr device, PXCMCapture.Device.Property pty, Single value);
Example #32
0
 /**
     @brief	Explicitly request to stream the specified raw stream. If specified more than one stream, 
     SenseManager will synchronize these streams. If called multiple times, the function treats each
     stream request as independent (unaligned). The stream identifier is PXCCapture.CUID+n.
     @param[in] type					The stream type.
     @param[in] width				stream width.
     @param[in] height				stream height.
     @return PXC_STATUS_NO_ERROR		Successful execution.
 */
 public pxcmStatus EnableStream(PXCMCapture.StreamType type, Int32 width, Int32 height)
 {
     return EnableStream(type, width, height, 0);
 }
Example #33
0
 internal static extern pxcmStatus PXCMCalibration_QueryStreamProjectionParametersEx(IntPtr instance, PXCMCapture.StreamType streamType, PXCMCapture.Device.StreamOption options, [Out] StreamCalibration calibration, [Out] StreamTransform transformation);
Example #34
0
 /** 
     @brief Feed captured samples to module for processing. If the samples are not available 
     immediately, the function will register to run the module processing when the samples 
     are ready. This is an asynchronous function. The application must synchronize the 
     returned SP before retrieving any module data, which is not available during processing.
     @param[in]  images	The samples from the capture device.
     @param[out] sp		The SP, to be returned.
     @return PXCM_STATUS_NO_ERROR	Successful execution.
 */
 public pxcmStatus ProcessImageAsync(PXCMCapture.Sample sample, out PXCMSyncPoint sp)
 {
     IntPtr sp2;
     pxcmStatus sts = PXCMVideoModule_ProcessImageAsync(instance, sample, out sp2);
     sp = (sts >= pxcmStatus.PXCM_STATUS_NO_ERROR) ? new PXCMSyncPoint(sp2, true) : null;
     return sts;
 }