Example #1
0
        /*
         * Assigns gaze result to outGazeResult.
         * Returns true if data and parameters exist, false otherwise.
         */
        public PXCMPointI32 QueryCalibPoint()
        {
            PXCMPointI32 cp = new PXCMPointI32();

            PXCMFaceData_GazeCalibData_QueryClibPoint(instance, ref cp);
            return(cp);
        }
    /*
     *  DepthBlend: blend the a foreground 2D image into the background color+depth image. the function rotates and
     *  scales the foreground 2D image before inserting it at a user specified coordinate and depth value.
     *
     *  sampleBackground: 2D+depth background image. The depth data should be hole-filled
     *  imgForeground: RGBA 2D foreground image
     *  insertCoord: (x,y) user-specified location of the 2D image center onto the background image
     *  insertDepth: user-specified depth value of the 2D image inside the background image.
     *  rotation[3]: is the Pitch, Yaw, Roll rotations in degrees in the Range: 0-360.
     *          rotaion[0]: pitch
     *          rotaion[1]: yaw
     *          rotaion[2]: roll
     *  scaleFG: scaling factor. E.g. 2.0 means 2x bigger.
     *  PXCMImage: he returned blended 2D image foreground + background.
     */
    public PXCMPhoto DepthBlend(PXCMPhoto sampleBackground, PXCMImage imgForeground,
                                PXCMPointI32 insertCoord, Int32 insertDepth, Int32[] rotation, Single scaleFG)
    {
        IntPtr image = PXCMEnhancedPhoto_DepthBlend(instance, sampleBackground.instance, (imgForeground == null) ? IntPtr.Zero : imgForeground.instance, insertCoord, insertDepth, rotation, scaleFG);

        return(image != IntPtr.Zero ? new PXCMPhoto(image, true) : null);
    }
Example #3
0
 internal static pxcmStatus QueryDataINT(IntPtr instance, out PXCMPointI32[] contour)
 {
     Int32 size = PXCMBlobData_IContour_QuerySize(instance);
     if (size > 0)
     {
         contour = new PXCMPointI32[size];
         return PXCMBlobData_IContour_QueryPoints(instance, size, contour);
     }
     else
     {
         contour = null;
         return pxcmStatus.PXCM_STATUS_DATA_UNAVAILABLE;
     }
 }
 internal static pxcmStatus QueryContourDataINT(IntPtr instance, Int32 index, out PXCMPointI32[] contour)
 {
     Int32 size = PXCMContourExtractor_QueryContourSize(instance, index);
     if (size > 0)
     {
         contour = new PXCMPointI32[size];
         return PXCMContourExtractor_QueryContourData(instance, index, size, contour);
     }
     else
     {
         contour = null;
         return pxcmStatus.PXCM_STATUS_DATA_UNAVAILABLE;
     }
 }
Example #5
0
        internal static pxcmStatus QueryContourDataINT(IntPtr instance, Int32 index, out PXCMPointI32[] contour)
        {
            Int32 size = PXCMBlobData_IBlob_QueryContourSize(instance, index);

            if (size > 0)
            {
                contour = new PXCMPointI32[size];
                return(PXCMBlobData_IBlob_QueryContourPoints(instance, index, size, contour));
            }
            else
            {
                contour = null;
                return(pxcmStatus.PXCM_STATUS_DATA_UNAVAILABLE);
            }
        }
Example #6
0
        internal static pxcmStatus QueryDataINT(IntPtr instance, out PXCMPointI32[] contour)
        {
            Int32 size = PXCMHandData_IContour_QuerySize(instance);

            if (size > 0)
            {
                contour = new PXCMPointI32[size];
                return(PXCMHandData_IContour_QueryPoints(instance, size, contour));
            }
            else
            {
                contour = null;
                return(pxcmStatus.PXCM_STATUS_DATA_UNAVAILABLE);
            }
        }
    /*
     *  PasteOnPlane: This function is provided for texturing a smaller 2D image (foreground)
     *  onto a bigger color + depth image (background). The smaller foreground image, is rendered according to a
     *  user-specified position and an auto-detected plane orientation onto the background image.
     *  The auto-oriented foreground image and the color data of the background image are composited together
     *  according to the alpha channal of the foreground image.
     *
     *  imbedIm: the image to imbed in the sample (foreground image)
     *  topLeftCoord, bottomLeftCoord: are the top left corner and the bottom left corner of where the user wants to embed the image.
     *  Returns the imbeded foreground with background image.
     */
    public PXCMPhoto PasteOnPlane(PXCMPhoto sample, PXCMImage imbedIm, PXCMPointI32 topLeftCoord, PXCMPointI32 bottomLeftCoord)
    {
        IntPtr image = PXCMEnhancedPhoto_PasteOnPlane(instance, sample.instance, (imbedIm == null) ? IntPtr.Zero : imbedIm.instance, topLeftCoord, bottomLeftCoord);

        return(image != IntPtr.Zero ? new PXCMPhoto(image, true) : null);
    }
    /*
     *  ComputeMaskFromCoordinate: convenience function that creates a mask directly from a depth coordinate.
     *  depthMap: input depth Map
     *  coord: input (x,y) coordinates on the depth map.
     *  Returns a mask in the form of PXCImage for blending with the current sample frame.
     *  Note: this function simply calls GetDepthThreshold then ComputeMaskFromThreshold in sequence.
     */
    public PXCMImage ComputeMaskFromCoordinate(PXCMPhoto sample, PXCMPointI32 coord)
    {
        IntPtr image = PXCMEnhancedPhoto_ComputeMaskFromCoordinate(instance, sample.instance, coord);

        return(image != IntPtr.Zero ? new PXCMImage(image, true) : null);
    }
 internal static extern IntPtr PXCMEnhancedPhoto_ComputeMaskFromCoordinate(IntPtr ep, IntPtr sample, PXCMPointI32 coord);
	    /* 
	        ComputeMaskFromCoordinate: convenience function that creates a mask directly from a depth coordinate.
	        depthMap: input depth Map
	        coord: input (x,y) coordinates on the depth map.  
	        Returns a mask in the form of PXCImage for blending with the current sample frame.
	        Note: this function simply calls GetDepthThreshold then ComputeMaskFromThreshold in sequence.
	    */
        public PXCMImage ComputeMaskFromCoordinate(PXCMPhoto sample, PXCMPointI32 coord)
        {
            IntPtr image = PXCMEnhancedPhoto_ComputeMaskFromCoordinate(instance, sample.instance, coord);
            return image != IntPtr.Zero ? new PXCMImage(image, true) : null;
        }
    /*
     * MeasureDistance: measure the distance between 2 points in mm
     * sample: is the photo instance
     * startPoint, endPoint: are the start pont and end point of the distance that need to be measured.
     * Note: Depth data must be availible and accurate at the start and end point selected.
     */

    public pxcmStatus MeasureDistance(PXCMPhoto sample, PXCMPointI32 startPoint, PXCMPointI32 endPoint, out MeasureData outData)
    {
        outData = new MeasureData();
        return(PXCMEnhancedPhoto_MeasureDistance(instance, sample.instance, startPoint, endPoint, outData));
    }
 /*
  *  DepthRefocus: refocus the image at input focusPoint by using depth data refocus
  *  sample: is the color and depth sample
  *  focusPoint: is the selected point foir refocussing.
  *  Note: The application must release the returned refocussed image
  */
 public PXCMPhoto DepthRefocus(PXCMPhoto sample, PXCMPointI32 focusPoint)
 {
     return(DepthRefocus(sample, focusPoint, 50.0F));
 }
	    /*
	        DepthBlend: blend the a foreground 2D image into the background color+depth image. the function rotates and 
	        scales the foreground 2D image before inserting it at a user specified coordinate and depth value. 

	        sampleBackground: 2D+depth background image. The depth data should be hole-filled
	        imgForeground: RGBA 2D foreground image 
	        insertCoord: (x,y) user-specified location of the 2D image center onto the background image
	        insertDepth: user-specified depth value of the 2D image inside the background image. 
	        rotation[3]: is the Pitch, Yaw, Roll rotations in degrees in the Range: 0-360. 
		        rotaion[0]: pitch 
		        rotaion[1]: yaw
		        rotaion[2]: roll
	        scaleFG: scaling factor. E.g. 2.0 means 2x bigger.
	        PXCMImage: he returned blended 2D image foreground + background.
	    */
        public PXCMPhoto DepthBlend(PXCMPhoto sampleBackground, PXCMImage imgForeground,
            PXCMPointI32 insertCoord, Int32 insertDepth, Int32[] rotation, Single scaleFG)
        {
            IntPtr image = PXCMEnhancedPhoto_DepthBlend(instance, sampleBackground.instance, (imgForeground == null) ? IntPtr.Zero : imgForeground.instance, insertCoord, insertDepth, rotation, scaleFG);
            return image != IntPtr.Zero ? new PXCMPhoto(image, true) : null;
        }
 /** 
     @brief Get the data of the contour line
     A contour is composed of a line, an array of 2D points describing the contour path
     @param[in] index the zero-based index of the requested contour
     @param[in] maxSize size of the allocated array for the contour points
     @param[out] contour points stored in the user allocated array		
     @return PXCM_STATUS_NO_ERROR if terminated successfully; otherwise, return the following error:
     PXCM_STATUS_PARAM_UNSUPPORTED if index is invalid or user allocated array is invalid 		
     PXCM__STATUS_ITEM_UNAVAILABLE if processImage is running or PXCMContourExtractor was not initialized.
 */
 public pxcmStatus QueryContourData(Int32 index, out PXCMPointI32[] contour)
 {
     return QueryContourDataINT(instance, index, out contour);
 }
 internal static extern IntPtr PXCMEnhancedPhoto_DepthRefocus(IntPtr ep, IntPtr sample, PXCMPointI32 focusPoint, Single aperture);
	    /* 
	        PasteOnPlane: This function is provided for texturing a smaller 2D image (foreground)
	        onto a bigger color + depth image (background). The smaller foreground image, is rendered according to a
	        user-specified position and an auto-detected plane orientation onto the background image.
	        The auto-oriented foreground image and the color data of the background image are composited together
	        according to the alpha channal of the foreground image.

	        imbedIm: the image to imbed in the sample (foreground image)
	        topLeftCoord, bottomLeftCoord: are the top left corner and the bottom left corner of where the user wants to embed the image.
	        Returns the imbeded foreground with background image.
	    */
        public PXCMPhoto PasteOnPlane(PXCMPhoto sample, PXCMImage imbedIm, PXCMPointI32 topLeftCoord, PXCMPointI32 bottomLeftCoord)
        {
            IntPtr image = PXCMEnhancedPhoto_PasteOnPlane(instance, sample.instance, (imbedIm == null) ? IntPtr.Zero : imbedIm.instance, topLeftCoord, bottomLeftCoord);
            return image != IntPtr.Zero ? new PXCMPhoto(image, true) : null;
        }
 internal static extern IntPtr PXCMEnhancedPhoto_ObjectSegment(IntPtr ep, IntPtr photo, PXCMPointI32 topLeftCoord, PXCMPointI32 bottomRightCoord);
 internal static extern IntPtr PXCMEnhancedPhoto_DepthBlend(IntPtr ep, IntPtr sampleBackground, IntPtr imgForegroundInstance,
                                                            PXCMPointI32 insertCoord, Int32 insertDepth, Int32[] rotation, Single scaleFG);
 internal static extern IntPtr PXCMEnhancedPhoto_PasteOnPlane(IntPtr ep, IntPtr sample, IntPtr imbedImInstance, PXCMPointI32 topLeftCoord, PXCMPointI32 bottomLeftCoord);
Example #20
0
 /*
 * Assigns gaze result to outGazeResult.
 * Returns true if data and parameters exist, false otherwise.
 */
 public PXCMPointI32 QueryCalibPoint()
 {
     PXCMPointI32 cp = new PXCMPointI32();
     PXCMFaceData_GazeCalibData_QueryClibPoint(instance, ref cp);
     return cp;
 }
Example #21
0
     /** 
    @brief Get the point array representing a contour line.
         
    @param[in] maxSize - the size of the array allocated for the contour points.
    @param[out] contour - the contour points stored in the user-allocated array.
 
    @return PXCM_STATUS_NO_ERROR - successful operation.           
    */
     public pxcmStatus QueryPoints(out PXCMPointI32[] contour)
     {
         return QueryDataINT(instance, out contour);
     }
    /*
     * ObjectSegment: generates an initial mask for any object selected by the bounding box.
     * The mask can then be refined by hints supplied by the user in RefineMask() function.
     * photo: input color and depth photo.
     * topLeftCoord    : top left corner of the object to segment.
     * bottomRightCoord: Bottom right corner of the object to segment.
     * Returns a mask in the form of PXCImage with detected pixels set to 255 and undetected pixels set to 0.
     */
    public PXCMImage ObjectSegment(PXCMPhoto photo, PXCMPointI32 topLeftCoord, PXCMPointI32 bottomRightCoord)
    {
        IntPtr image = PXCMEnhancedPhoto_ObjectSegment(instance, photo.instance, topLeftCoord, bottomRightCoord);

        return(image == IntPtr.Zero ? null : new PXCMImage(image, true));
    }
 internal static extern pxcmStatus PXCMEnhancedPhoto_MeasureDistance(IntPtr ep, IntPtr sample, PXCMPointI32 startPoint, PXCMPointI32 endPoint, [Out] MeasureData outData);
    /*
     *  DepthRefocus: refocus the image at input focusPoint by using depth data refocus
     *  sample: is the color and depth sample
     *  focusPoint: is the selected point foir refocussing.
     *  aperture: Range of the blur area [1-100]
     *  Note: The application must release the returned refocussed image
     */
    public PXCMPhoto DepthRefocus(PXCMPhoto sample, PXCMPointI32 focusPoint, Single aperture)
    {
        IntPtr image = PXCMEnhancedPhoto_DepthRefocus(instance, sample.instance, focusPoint, aperture);

        return(image != IntPtr.Zero ? new PXCMPhoto(image, true) : null);
    }
	    /*
	        DepthRefocus: refocus the image at input focusPoint by using depth data refocus
	        sample: is the color and depth sample
	        focusPoint: is the selected point foir refocussing.
	        Note: The application must release the returned refocussed image
	    */
        public PXCMPhoto DepthRefocus(PXCMPhoto sample, PXCMPointI32 focusPoint)
        {
            return DepthRefocus(sample, focusPoint, 50.0F);
	    }
	    /* 
	    ObjectSegment: generates an initial mask for any object selected by the bounding box. 
	    The mask can then be refined by hints supplied by the user in RefineMask() function. 
	    photo: input color and depth photo.
	    topLeftCoord    : top left corner of the object to segment.  
	    bottomRightCoord: Bottom right corner of the object to segment.
	    Returns a mask in the form of PXCImage with detected pixels set to 255 and undetected pixels set to 0.
	    */
	    public PXCMImage ObjectSegment(PXCMPhoto photo, PXCMPointI32 topLeftCoord, PXCMPointI32 bottomRightCoord) {
            IntPtr image=PXCMEnhancedPhoto_ObjectSegment(instance, photo.instance, topLeftCoord, bottomRightCoord);
            return image == IntPtr.Zero ? null : new PXCMImage(image, true);
        }
 internal static extern Single PXCMEnhancedPhoto_GetDepthThreshold(IntPtr ep, IntPtr sample, PXCMPointI32 coord);
Example #28
0
 internal static extern void PXCMFaceData_GazeCalibData_QueryClibPoint(IntPtr instance, ref PXCMPointI32 cp);
        /* 
           MeasureDistance: measure the distance between 2 points in mm
           sample: is the photo instance
           startPoint, endPoint: are the start pont and end point of the distance that need to be measured.
           Note: Depth data must be availible and accurate at the start and end point selected. 
        */

        public pxcmStatus MeasureDistance(PXCMPhoto sample, PXCMPointI32 startPoint, PXCMPointI32 endPoint, out MeasureData outData)
        {
            outData = new MeasureData();
            return PXCMEnhancedPhoto_MeasureDistance(instance, sample.instance, startPoint, endPoint, outData);
        }
	    /* 
	        DepthRefocus: refocus the image at input focusPoint by using depth data refocus
	        sample: is the color and depth sample
	        focusPoint: is the selected point foir refocussing.
	        aperture: Range of the blur area [1-100] 
	        Note: The application must release the returned refocussed image
	    */
        public PXCMPhoto DepthRefocus(PXCMPhoto sample, PXCMPointI32 focusPoint, Single aperture) 
        {
            IntPtr image = PXCMEnhancedPhoto_DepthRefocus(instance, sample.instance, focusPoint, aperture);
            return image != IntPtr.Zero ? new PXCMPhoto(image, true) : null;
        }
Example #31
0
 internal static extern void PXCMFaceData_GazeCalibData_QueryClibPoint(IntPtr instance, ref PXCMPointI32 cp);