Exemple #1
0
        private Mat getFrame(int pingNum)
        {
            Mat m;

            if (_captureInProgress == false)
            {
                _captureInProgress = true;
                MagImage mg = getMagImage(pingNum);
                if (ping_num < pingCount && sonarType != "NET")
                {
                    ping_num++;
                }

                ColorImage c = getColorImage(mg);
                m = getMatImage(c);

                //Colorimage needs to be disposed after being sent to screen
                //c.Dispose();
            }
            else
            {
                //Do nothing if it is already processing?
                m = new Mat();
            }

            return(m);
        }
Exemple #2
0
        public ColorImage getColorImage(MagImage mImg)
        {
            ColorMapper cmap = new ColorMapper();
            ColorImage  cimg = null;

            if (mImg != null)
            {
                cmap.Load(@"C:\jet.cmap");
                cimg = cmap.MapImage(mImg);
            }
            cmap.Dispose();
            mImg.Dispose();

            return(cimg == null ? new ColorImage() : cimg);
        }                   //TODO: Examine different color maps, choose
Exemple #3
0
        public MagImage GetImageRTheta()
        {
            IntPtr img_ptr = new IntPtr();

            if (_disposed)
            {
                throw new ObjectDisposedException("BVTPing");
            }
            int error_code = NativeMethods.BVTPing_GetImageRTheta(_handle, ref img_ptr);

            GC.KeepAlive(this);
            if (0 != error_code)
            {
                throw new SdkException(error_code);
            }
            MagImage img = new MagImage(img_ptr);

            return(img);
        }
        /// <summary>
        /// Apply a colormap to an intensity image to produce a ColorImage.
        /// </summary>
        /// <param name="input">Input magnitude image </param>
        /// <returns>Output color image </returns>
        public ColorImage MapImage(MagImage input)
        {
            IntPtr output_ptr = new IntPtr();

            if (_disposed)
            {
                throw new ObjectDisposedException("BVTColorMapper");
            }
            int error_code = NativeMethods.BVTColorMapper_MapImage(_handle, input.Handle, ref output_ptr);

            GC.KeepAlive(this);
            if (0 != error_code)
            {
                throw new SdkException(error_code);
            }
            ColorImage output = new ColorImage(output_ptr);

            return(output);
        }
Exemple #5
0
 public void saveMagImage(MagImage mImg, string filePath)
 {
     mImg.SavePGM(filePath);
     mImg.Dispose();
 }