Exemple #1
0
        /// <summary>
        /// Label the connected parts of a binary image. (cvLabel)
        /// </summary>
        /// <param name="img">Input binary image (depth=IPL_DEPTH_8U and num. channels=1).</param>
        /// <returns>Number of pixels that has been labeled.</returns>
        public int Label(IplImage img)
        {
            if (img == null)
            {
                throw new ArgumentNullException("img");
            }

            Labels = new LabelData(img.Height, img.Width, img.ROI);
            return(Labeller.Perform(img, this));
        }
Exemple #2
0
        /// <summary>
        /// Label the connected parts of a binary image. (cvLabel)
        /// </summary>
        /// <param name="img">Input binary image (depth=IPL_DEPTH_8U and num. channels=1).</param>
        /// <returns>Number of pixels that has been labeled.</returns>
        public int Label(Mat img)
        {
            if (img == null)
            {
                throw new ArgumentNullException(nameof(img));
            }

            Labels = new LabelData(img.Height, img.Width);
            return(Labeller.Perform(img, this));
        }