Ejemplo n.º 1
0
 protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
 {
     if (windowService != null)
     {
         if (objectProvider != null)
         {
             try
             {
                 UnmanagedObject mat = objectProvider.GetObject() as UnmanagedObject;
                 if (mat != null)
                 {
                     using (MatrixViewer viewer = new MatrixViewer())
                     {
                         viewer.Matrix = mat;
                         windowService.ShowDialog(viewer);
                     }
                 }
             }
             catch (Exception ex)
             {
                 //TODO
             }
         }
     }
 }
Ejemplo n.º 2
0
        protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
        {
            UnmanagedObject mat = objectProvider.GetObject() as UnmanagedObject;

            if (mat != null)
            {
                using (MatrixViewer viewer = new MatrixViewer())
                {
                    viewer.Matrix = mat;
                    windowService.ShowDialog(viewer);
                }
            }
        }
Ejemplo n.º 3
0
        protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
        {
            UnmanagedObject matND = objectProvider.GetObject() as UnmanagedObject;

            if (matND != null)
            {
                MCvMatND cvMatND = (MCvMatND)Marshal.PtrToStructure(matND.Ptr, typeof(MCvMatND));
                if (cvMatND.dims > 3 || (cvMatND.dims == 3 && cvMatND.dim[2].Size > 4))
                {
                    MessageBox.Show("MatND of dimension > 3 is not supported for debugger visualizer");
                    return;
                }

                UnmanagedObject matrix   = null;
                int             rows     = cvMatND.dim[0].Size;
                int             cols     = cvMatND.dims >= 2 ? cvMatND.dim[1].Size : 1;
                int             channels = cvMatND.dims >= 3 ? cvMatND.dim[2].Size : 1;
                if (matND is MatND <float> )
                {
                    matrix = new Matrix <float>(rows, cols, channels);
                }
                else if (matND is MatND <int> )
                {
                    matrix = new Matrix <int>(rows, cols, channels);
                }
                else if (matND is MatND <double> )
                {
                    matrix = new Matrix <double>(rows, cols, channels);
                }

                if (matrix == null)
                {
                    MessageBox.Show(String.Format("{0} is not supported", cvMatND.type.ToString()));
                    return;
                }

                CvInvoke.cvCopy(matND.Ptr, matrix.Ptr, IntPtr.Zero);

                using (MatrixViewer viewer = new MatrixViewer())
                {
                    viewer.Matrix = matrix;
                    windowService.ShowDialog(viewer);
                }
            }
        }