Esempio n. 1
0
 // contructor take only the camera name, the interface is the default interface
 public Camera(string device)
 {
     try
     {
         this.OpenFramegrabber(interfaceName, 0, 0, 0, 0, 0, 0, "default", -1,
                               "default", -1, "false", "default", device, 0, -1);
         this.device = device;
         readParamater();
     }
     catch (HOperatorException ex)
     {
         Utilitiy.write_error(this.GetType().FullName, System.Reflection.MethodBase.GetCurrentMethod().ToString(), ex, DataType.eErrors.Exeption);
     }
 }
Esempio n. 2
0
 // Constructor, have same parameter as OpenFramegrabber(.....)
 public Camera(string name, int horizontalResolution, int verticalResolution, int imageWidth, int imageHeight,
               int startRow, int startColumn, string field, int bitsPerChannel, string colorSpace, double generic,
               string externalTrigger, string cameraType,
               string device, int port, int lineIn)
 {
     try
     {
         this.OpenFramegrabber(name, horizontalResolution, verticalResolution, imageWidth, imageHeight, startRow, startColumn, field, bitsPerChannel, colorSpace, generic, externalTrigger, cameraType, device, port, lineIn);
     }
     catch (HOperatorException ex)
     {
         Utilitiy.write_error(this.GetType().FullName, System.Reflection.MethodBase.GetCurrentMethod().ToString(), ex, DataType.eErrors.Exeption);
     }
 }
Esempio n. 3
0
 public void readCamParam()
 {
     try
     {
         FileInfo fi = new FileInfo(dirPath + @"\Cameras\" + cameraName + @"\camera_parameters.dat");
         if (fi.Exists)
         {
             CameraParameter = HMisc.ReadCamPar(fi.FullName);
         }
     }
     catch (HOperatorException ex)
     {
         Utilitiy.write_error(this.GetType().FullName, System.Reflection.MethodBase.GetCurrentMethod().ToString(), ex, DataType.eErrors.Exeption);
     }
     catch (Exception ex)
     {
         Utilitiy.write_error(this.GetType().FullName, System.Reflection.MethodBase.GetCurrentMethod().ToString(), ex, DataType.eErrors.Exeption);
     }
 }
Esempio n. 4
0
        /*
         * ~Camera()
         * {
         *  // readParamater();
         * }
         */
        #endregion // Constructors

        #region methods

        public void readParamater()
        {
            diCurrent = new DirectoryInfo(".\\");                               // current directory
            diCamera  = new DirectoryInfo(dirPath + @"\Cameras\" + cameraName); // camera directory
            //
            try
            {
                if (!diCamera.Exists)
                {
                    // if camera folder doesn't exist, I create it
                    diCurrent.CreateSubdirectory(dirPath + @"\Cameras\" + cameraName);
                }
                else
                {
                    // if exist, I read the data from the folder if they exist: calibration paramter, ....
                    readCamParam();
                }
            }
            catch (Exception ex)
            {
                Utilitiy.write_error(this.GetType().FullName, System.Reflection.MethodBase.GetCurrentMethod().ToString(), ex, DataType.eErrors.Exeption);
            }
        }