/// <summary>
        /// in place flood fill.
        /// </summary>
        /// <param name="oSeed">Image location of seed pixel value to be used for comparison.</param>
        /// <param name="nMin">Value of each element of tested pixel must be &gt;= the corresponding seed value - aMin value.</param>
        /// <param name="nMax">Valeu of each element of tested pixel must be &lt;= the corresponding seed value + aMax value.</param>
        /// <param name="nNewValue">Image pixel values to be used to replace matching pixels.</param>
        /// <param name="nBoundaryValue">Image pixel values to be used for region boundary. </param>
        /// <param name="eNorm">Type of pixel connectivity test to use, nppiNormInf will use 8 way connectivity and nppiNormL1 will use 4 way connectivity. </param>
        /// <param name="pBuffer">Pointer to device memory scratch buffer at least as large as value returned by the corresponding LabelMarkersUFGetBufferSize call.</param>
        public NppiConnectedRegion FloodFillGradient(NppiPoint oSeed, uint nMin, uint nMax, uint nNewValue, uint nBoundaryValue, NppiNorm eNorm, CudaDeviceVariable <byte> pBuffer)
        {
            NppiConnectedRegion pConnectedRegion = new NppiConnectedRegion();

            status = NPPNativeMethods.NPPi.FloodFill.nppiFloodFillGradientBoundary_32u_C1IR(_devPtrRoi, _pitch, oSeed, nMin, nMax, nNewValue, nBoundaryValue, eNorm, _sizeRoi, ref pConnectedRegion, pBuffer.DevicePointer);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiFloodFillGradientBoundary_32u_C1IR", status));
            NPPException.CheckNppStatus(status, this);
            return(pConnectedRegion);
        }
Exemplo n.º 2
0
        /// <summary>
        /// in place flood fill.
        /// </summary>
        /// <param name="oSeed">Image location of seed pixel value to be used for comparison.</param>
        /// <param name="nNewValue">Image pixel values to be used to replace matching pixels.</param>
        /// <param name="eNorm">Type of pixel connectivity test to use, nppiNormInf will use 8 way connectivity and nppiNormL1 will use 4 way connectivity. </param>
        /// <param name="pBuffer">Pointer to device memory scratch buffer at least as large as value returned by the corresponding LabelMarkersUFGetBufferSize call.</param>
        /// <param name="nppStreamCtx">NPP stream context.</param>
        public NppiConnectedRegion FloodFill(NppiPoint oSeed, uint nNewValue, NppiNorm eNorm, CudaDeviceVariable <byte> pBuffer, NppStreamContext nppStreamCtx)
        {
            NppiConnectedRegion pConnectedRegion = new NppiConnectedRegion();

            status = NPPNativeMethods_Ctx.NPPi.FloodFill.nppiFloodFill_32u_C1IR_Ctx(_devPtrRoi, _pitch, oSeed, nNewValue, eNorm, _sizeRoi, ref pConnectedRegion, pBuffer.DevicePointer, nppStreamCtx);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiFloodFill_32u_C1IR_Ctx", status));
            NPPException.CheckNppStatus(status, this);
            return(pConnectedRegion);
        }