Пример #1
0
 /**
  *  EnableTracker: creates an object tracker with a specific tracking method and an
  *  initial bounding mask as a hint for the object to detect.
  *  boundingMask: a hint on what object to detect setting the target pixels to 255 and background to 0.
  *  method: Tracking method for depth layer tracking or object tracking.
  */
 public pxcmStatus EnableTracker(PXCMImage boundingMask, TrackMethod method)
 {
     return(PXCMEnhancedVideo_EnableTracker(instance, (boundingMask == null)? IntPtr.Zero: boundingMask.instance, method));
 }
Пример #2
0
 /**			
     @brief Extract the contour of the blob in the given image
     Given an image of a blob, in which object pixels are white (set to 255) and all other pixels are black (set to 0),
     extract the contour lines of the blob.
     Note that there might be multiple contour lines, if the blob contains "holes".
     @param[in] blobImage the blob-image to be processed
     @return PXCM_STATUS_NO_ERROR if a valid blob image exists and could be processed; otherwise, return the following error:
     PXCM_STATUS_DATA_UNAVAILABLE - if image is not available or PXCM_STATUS_ITEM_UNAVAILABLE if processImage is running or PXCMContourExtractor was not initialized.		
 */
 public pxcmStatus ProcessImage(PXCMImage depthImage)
 {
     return PXCMContourExtractor_ProcessImage(instance, depthImage.instance);
 }
Пример #3
0
 public pxcmStatus Set2DTrackFromImage(PXCMImage image, out Int32 cosID, Boolean extensible)
 {
     return(Set2DTrackFromImage(image, out cosID, 0.0f, 0.0f, 0.8f, extensible));
 }
Пример #4
0
 public static string ToString(this PXCMImage.PixelFormat format)
 {
     return(PXCMImage.PixelFormatToString(format));
 }
Пример #5
0
 /**
  *  @brief Map color coordinates to depth coordiantes for a few pixels.
  *  @param[in]  depth       The depthmap image.
  *  @param[in]	pos_ij		The array of color coordinates.
  *  @param[out]	pos_uv		The array of depth coordinates, to be returned.
  *  @return PXCM_STATUS_NO_ERROR Successful execution.
  */
 public pxcmStatus MapColorToDepth(PXCMImage depth, PXCMPointF32[] pos_ij, PXCMPointF32[] pos_uv)
 {
     return(PXCMProjection_MapColorToDepth(instance, depth.instance, pos_ij.Length, pos_ij, pos_uv));
 }
Пример #6
0
 public pxcmStatus Set2DTrackFromImage(PXCMImage image, out Int32 cosID, Boolean extensible)
 {
     return Set2DTrackFromImage(image, out cosID, 0.0f, 0.0f, 0.8f, extensible);
 }
Пример #7
0
 /** 
     @brief Get the color pixel for every depth pixel using the UV map, and output a color image, aligned in space 
         and resolution to the depth image.
     @param[in] depth		The depth image instance.
     @param[in] color		The color image instance.
     @return The output image in the depth image resolution.
 */
 public PXCMImage CreateColorImageMappedToDepth(PXCMImage depth, PXCMImage color)
 {
     IntPtr mappedColor = PXCMProjection_CreateColorImageMappedToDepth(instance, depth.instance, color.instance);
     return mappedColor != IntPtr.Zero ? new PXCMImage(mappedColor, true) : null;
 }
Пример #8
0
 /**
  * @brief Copy image data from another image sample.
  * @param[in] src_image        The image sample to copy data from.
  * @return PXC_STATUS_NO_ERROR     Successful execution.
  */
 public pxcmStatus CopyImage(PXCMImage src_image)
 {
     return(PXCMImage_CopyImage(instance, src_image.instance));
 }
Пример #9
0
    /*
     *  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);
    }
Пример #10
0
	    /*
	        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;
        }
Пример #11
0
	    /* 
	    RefineMask: refines the mask generated by the ObjectSegment() function by using hints.
        hints: input mask with hints. hint values.
         0 = no hint
         1 = foreground
         2 = background
	    Returns a mask in the form of PXCImage with detected pixels set to 255 and undetected pixels set to 0.
	    */
	    public PXCMImage RefineMask(PXCMImage hints) {
            IntPtr image = PXCMEnhancedPhoto_RefineMask(instance, (hints == null)?IntPtr.Zero: hints.instance);
            return image == IntPtr.Zero ? null : new PXCMImage(image, true);
        }
Пример #12
0
	    /* 
	        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;
        }
Пример #13
0
    public pxcmStatus EnableTracker(PXCMImage boundingMask) { 
		return EnableTracker(boundingMask, TrackMethod.LAYER);
	}
Пример #14
0
    /**
	 *  EnableTracker: creates an object tracker with a specific tracking method and an 
     *  initial bounding mask as a hint for the object to detect. 
	 *  boundingMask: a hint on what object to detect setting the target pixels to 255 and background to 0.  
	 *  method: Tracking method for depth layer tracking or object tracking.
	*/
	public pxcmStatus EnableTracker(PXCMImage boundingMask, TrackMethod method) 
    {
        return PXCMEnhancedVideo_EnableTracker(instance, (boundingMask == null)? IntPtr.Zero: boundingMask.instance, method);
    }
Пример #15
0
 internal static extern IntPtr PXCMSession_CreateImage(IntPtr session, PXCMImage.ImageInfo info, PXCMImage.ImageData data);
Пример #16
0
    /*
     * RefineMask: refines the mask generated by the ObjectSegment() function by using hints.
     * hints: input mask with hints. hint values.
     * 0 = no hint
     * 1 = foreground
     * 2 = background
     * Returns a mask in the form of PXCImage with detected pixels set to 255 and undetected pixels set to 0.
     */
    public PXCMImage RefineMask(PXCMImage hints)
    {
        IntPtr image = PXCMEnhancedPhoto_RefineMask(instance, (hints == null)?IntPtr.Zero: hints.instance);

        return(image == IntPtr.Zero ? null : new PXCMImage(image, true));
    }
Пример #17
0
        /**
        * Add a 2D reference image for tracking an object

        * \param image: Target image data
        * \param[out] cosID: coordinate system ID of added target
        * \param widthMM: image width in mm (optional)
        * \param heightMM: image height in mm (optional)
        * \param qualityThreshold: minimal similarity measure [0..1] that has to be fulfilled for
        *                          the image or one of its sub-patches.
        * \param extensible: Use features from the environment to improve tracking
        */
        public pxcmStatus Set2DTrackFromImage(PXCMImage image, out Int32 cosID, Single widthMM, Single heightMM, Single qualityThreshold, Boolean extensible)
        {
            if (image == null)
            {
                cosID = 0;
                return pxcmStatus.PXCM_STATUS_HANDLE_INVALID;
            }

            return PXCMTracker_Set2DTrackFromImage(instance, image.instance, out cosID, widthMM, heightMM, qualityThreshold, extensible);
        }
Пример #18
0
 /**
  *  @brief Retrieve the 2D image mask of the blob and its associated blob data
  *  The blobs are ordered from the largest to the smallest (in number of pixels)
  *  @see BlobData
  *  @param[in] index the zero-based index of the requested blob (has to be between 0 to number of blobs)
  *  @param[out] segmentationImage the 2D image mask of the requested blob
  *  @param[out] blobData the data of the requested blob
  *  @return PXCM_STATUS_NO_ERROR if index is valid and processImage terminated successfully; otherwise, return the following error:
  *  PXCM_STATUS_PARAM_UNSUPPORTED if index is invalid or PXCM_STATUS_ITEM_UNAVAILABLE if processImage is running or PXCMBlobExtractor was not initialized.
  */
 public pxcmStatus QueryBlobData(Int32 index, PXCMImage segmentationImage, out BlobData blobData)
 {
     return(QueryBlobDataINT(instance, index, segmentationImage.instance, out blobData));
 }
Пример #19
0
 /** 
     @brief Retrieve the inverse UV map for the specific depth image. The inverse UV map maps color coordinates
     back to the depth coordinates. The inverse UVMap is a PXCMPointF32 array of color size width*height.
     @param[in]  depth		The depth image instance.
     @param[out] inv_uvmap	The inverse UV map, to be returned.
     @return PXCM_STATUS_NO_ERROR Successful execution.
 */
 public pxcmStatus QueryInvUVMap(PXCMImage depth, PXCMPointF32[] inv_uvmap)
 {
     return PXCMProjection_QueryInvUVMap(instance, depth.instance, inv_uvmap);
 }
Пример #20
0
 /** 
 @brief Set the sample options. This function overrides any previously set options.
 @param[in] options      The image options.
 */
 public void SetOptions(PXCMImage.Option options)
 {
     PXCMImage_SetOptions(instance, options);
 }
Пример #21
0
 /** 
     @brief Map color coordinates to depth coordiantes for a few pixels.
     @param[in]  depth       The depthmap image.
     @param[in]	pos_ij		The array of color coordinates.
     @param[out]	pos_uv		The array of depth coordinates, to be returned.
     @return PXCM_STATUS_NO_ERROR Successful execution.
 */
 public pxcmStatus MapColorToDepth(PXCMImage depth, PXCMPointF32[] pos_ij, PXCMPointF32[] pos_uv)
 {
     return PXCMProjection_MapColorToDepth(instance, depth.instance, pos_ij.Length, pos_ij, pos_uv);
 }
Пример #22
0
 /**    
 @brief Copy image data from another image sample.
 @param[in] src_image        The image sample to copy data from.
 @return PXC_STATUS_NO_ERROR     Successful execution.
 */
 public pxcmStatus CopyImage(PXCMImage src_image)
 {
     return PXCMImage_CopyImage(instance, src_image.instance);
 }
Пример #23
0
    /**
     *  @brief Map every depth pixel to the color image resolution using the UV map, and output an incomplete
     *  depth image (with holes), aligned in space and resolution to the color image.
     *  @param[in] depth		The depth image instance.
     *  @param[in] color		The color image instance.
     *  @return The output image in the color image resolution.
     */
    public PXCMImage CreateDepthImageMappedToColor(PXCMImage depth, PXCMImage color)
    {
        IntPtr mappedDepth = PXCMProjection_CreateDepthImageMappedToColor(instance, depth.instance, color.instance);

        return(mappedDepth != IntPtr.Zero ? new PXCMImage(mappedDepth, true) : null);
    }
Пример #24
0
 /** 
 @brief Copy image data from the specified external buffer.
 @param[in] data             The ImageData structure that describes the image buffer.
 @param[in] options          Reserved.
 @return PXCM_STATUS_NO_ERROR     Successful execution.
 */
 public pxcmStatus ImportData(PXCMImage.ImageData data, Int32 flags)
 {
     return PXCMImage_ImportData(instance, data, flags);
 }
Пример #25
0
 /**
     @brief initialize PXCMContourExtractor instance for a specific image type (size)
     @param[in] imageInfo definition of the images that should be processed
     @see PXCMImage.ImageInfo
 */
 public void Init(PXCMImage.ImageInfo imageInfo)
 {
     PXCMContourExtractor_Init(instance, imageInfo);
 }
Пример #26
0
 internal static IntPtr[] Array2IntPtrs(PXCMImage[] images)
 {
     IntPtr[] images2 = new IntPtr[images.Length];
     for (int i = 0; i < images.Length; i++)
         if (images[i] != null)
             images2[i] = images[i].instance;
     return images2;
 }
Пример #27
0
 public pxcmStatus Set2DTrackFromImage(PXCMImage image, out Int32 cosID, Single widthMM, Single heightMM, Single qualityThreshold)
 {
     return(Set2DTrackFromImage(image, out cosID, widthMM, heightMM, qualityThreshold, false));
 }
Пример #28
0
 internal static extern void PXCMContourExtractor_Init(IntPtr instsance, PXCMImage.ImageInfo imageInfo);
Пример #29
0
 public pxcmStatus Set2DTrackFromImage(PXCMImage image, out Int32 cosID)
 {
     return(Set2DTrackFromImage(image, out cosID, 0.0f, 0.0f, 0.8f, false));
 }
Пример #30
0
 internal static extern void PXCMImage_SetOptions(IntPtr image, PXCMImage.Option options);
Пример #31
0
 public pxcmStatus EnableTracker(PXCMImage boundingMask)
 {
     return(EnableTracker(boundingMask, TrackMethod.LAYER));
 }
Пример #32
0
 internal static extern pxcmStatus PXCMImage_ImportData(IntPtr image, PXCMImage.ImageData data, Int32 flags);
Пример #33
0
 /**
  *  @brief Extract the contour of the blob in the given image
  *  Given an image of a blob, in which object pixels are white (set to 255) and all other pixels are black (set to 0),
  *  extract the contour lines of the blob.
  *  Note that there might be multiple contour lines, if the blob contains "holes".
  *  @param[in] blobImage the blob-image to be processed
  *  @return PXCM_STATUS_NO_ERROR if a valid blob image exists and could be processed; otherwise, return the following error:
  *  PXCM_STATUS_DATA_UNAVAILABLE - if image is not available or PXCM_STATUS_ITEM_UNAVAILABLE if processImage is running or PXCMContourExtractor was not initialized.
  */
 public pxcmStatus ProcessImage(PXCMImage depthImage)
 {
     return(PXCMContourExtractor_ProcessImage(instance, depthImage.instance));
 }
Пример #34
0
 /**
     @brief initialize PXCMBlobExtractor instance for a specific image type (size)
     @param[in] imageInfo definition of the images that should be processed
     @see PXCMImage.ImageInfo
 */
 public void Init(PXCMImage.ImageInfo imageInfo)
 {
     PXCMBlobExtractor_Init(instance, imageInfo);
 }
Пример #35
0
 public pxcmStatus Set2DTrackFromImage(PXCMImage image, out Int32 cosID, Single widthMM, Single heightMM, Single qualityThreshold)
 {
     return Set2DTrackFromImage(image, out cosID, widthMM, heightMM, qualityThreshold, false);
 }
Пример #36
0
 /**
     @brief Retrieve the 2D image mask of the blob and its associated blob data
     The blobs are ordered from the largest to the smallest (in number of pixels)
     @see BlobData
     @param[in] index the zero-based index of the requested blob (has to be between 0 to number of blobs) 
     @param[out] segmentationImage the 2D image mask of the requested blob
     @param[out] blobData the data of the requested blob
     @return PXCM_STATUS_NO_ERROR if index is valid and processImage terminated successfully; otherwise, return the following error:
     PXCM_STATUS_PARAM_UNSUPPORTED if index is invalid or PXCM_STATUS_ITEM_UNAVAILABLE if processImage is running or PXCMBlobExtractor was not initialized.
 */
 public pxcmStatus QueryBlobData(Int32 index, PXCMImage segmentationImage, out BlobData blobData)
 {
     return QueryBlobDataINT(instance, index, segmentationImage.instance, out blobData);
 }
Пример #37
0
 public pxcmStatus Set2DTrackFromImage(PXCMImage image, out Int32 cosID)
 {
     return Set2DTrackFromImage(image, out cosID, 0.0f, 0.0f, 0.8f, false);
 }
Пример #38
0
 /**
  *  @brief Retrieve the inverse UV map for the specific depth image. The inverse UV map maps color coordinates
  *  back to the depth coordinates. The inverse UVMap is a PXCMPointF32 array of color size width*height.
  *  @param[in]  depth		The depth image instance.
  *  @param[out] inv_uvmap	The inverse UV map, to be returned.
  *  @return PXCM_STATUS_NO_ERROR Successful execution.
  */
 public pxcmStatus QueryInvUVMap(PXCMImage depth, PXCMPointF32[] inv_uvmap)
 {
     return(PXCMProjection_QueryInvUVMap(instance, depth.instance, inv_uvmap));
 }
Пример #39
0
 /** 
     @brief Retrieve the vertices for the specific depth image. The vertices is a PXCMPoint3DF32 array of depth 
     size width*height. The world coordiantes units are in mm.
     @param[in]  depth		The depth image instance.
     @param[out] inv_uvmap	The inverse UV map, to be returned.
     @return PXCM_STATUS_NO_ERROR Successful execution.
 */
 public pxcmStatus QueryVertices(PXCMImage depth, PXCMPoint3DF32[] vertices)
 {
     return PXCMProjection_QueryVertices(instance, depth.instance, vertices);
 }
Пример #40
0
 /**
  *  @brief Retrieve the vertices for the specific depth image. The vertices is a PXCMPoint3DF32 array of depth
  *  size width*height. The world coordiantes units are in mm.
  *  @param[in]  depth		The depth image instance.
  *  @param[out] inv_uvmap	The inverse UV map, to be returned.
  *  @return PXCM_STATUS_NO_ERROR Successful execution.
  */
 public pxcmStatus QueryVertices(PXCMImage depth, PXCMPoint3DF32[] vertices)
 {
     return(PXCMProjection_QueryVertices(instance, depth.instance, vertices));
 }
Пример #41
0
 /** 
     @brief Map every depth pixel to the color image resolution using the UV map, and output an incomplete 
     depth image (with holes), aligned in space and resolution to the color image. 
     @param[in] depth		The depth image instance.
     @param[in] color		The color image instance.
     @return The output image in the color image resolution.
 */
 public PXCMImage CreateDepthImageMappedToColor(PXCMImage depth, PXCMImage color)
 {
     IntPtr mappedDepth = PXCMProjection_CreateDepthImageMappedToColor(instance, depth.instance, color.instance);
     return mappedDepth != IntPtr.Zero ? new PXCMImage(mappedDepth, true) : null;
 }
Пример #42
0
    /**
     *  @brief Get the color pixel for every depth pixel using the UV map, and output a color image, aligned in space
     *      and resolution to the depth image.
     *  @param[in] depth		The depth image instance.
     *  @param[in] color		The color image instance.
     *  @return The output image in the depth image resolution.
     */
    public PXCMImage CreateColorImageMappedToDepth(PXCMImage depth, PXCMImage color)
    {
        IntPtr mappedColor = PXCMProjection_CreateColorImageMappedToDepth(instance, depth.instance, color.instance);

        return(mappedColor != IntPtr.Zero ? new PXCMImage(mappedColor, true) : null);
    }
Пример #43
0
            /**			
                @brief Retrieve the 2D image mask of the tracked hand. 	 
                In the image mask, each pixel occupied by the hand is white (value of 255) and all other pixels are black (value of 0).
                @note This information is available only when the segmentation image is enabled.
                @see PXCHandConfiguration::EnableSegmentationImage
			
                @param[out] image - the 2D image mask.
			
                @return PXCM_STATUS_NO_ERROR - operation succeeded.
                @return PXCM_STATUS_DATA_UNAVAILABLE - image mask is not available.		
            */
            public pxcmStatus QuerySegmentationImage(out PXCMImage image)
            {
                IntPtr image2;
                pxcmStatus sts = PXCMHandData_IHand_QuerySegmentationImage(instance, out image2);
                image = (sts >= pxcmStatus.PXCM_STATUS_NO_ERROR) ? new PXCMImage(image2, false) : null;
                return sts;
            }
Пример #44
0
        /** 
            @brief: Fills holes in the supplied depth image.

            @param[in] depthImage: Instance of depth image to be filled. 
			Pixels with depth value equal to zero will be linearly interpolated 
			with adjacent depth pixels. The image resolution should be 320X240


            @returns: On Success PXCM_STATUS_NO_ERROR,
            Otherwise error code will be returned on failure
        */
        public pxcmStatus FillDepthImage(PXCMImage depthImage)
        {
            return PXCMScenePerception_FillDepthImage(instance, depthImage.instance);
        }