Esempio n. 1
0
        public IplImage BuildIntegral(string Path)
        {
            // Builds the ImageIntegral. maybe takes a file if already saved.
            IplImage vret = null;

            float[] imageDataD = COpenSURF.ImageIntegral(imageData, width, height, widthStep);

            if (Path != null)
            {
                FileStream pfd = null;
                try
                {
                    pfd = new FileStream(Path + ".INT", FileMode.Create, FileAccess.Write);
                    BinaryWriter pbw = new BinaryWriter(pfd);
                    pbw.Write(width);
                    pbw.Write(height);
                    foreach (float value in imageDataD)
                    {
                        pbw.Write(value);
                    }
                }
                finally
                {
                    if (pfd != null)
                    {
                        pfd.Close();
                    }
                }
            }

            vret = new IplImage(imageDataD, width, height, widthStep);

            return(vret);
        }