Bienvenido: Ingresar
location: Diferencias para "HowTo/BUC2203LinuxInst"
Diferencias entre las revisiones 3 y 8 (abarca 5 versiones)
Versión 3 con fecha 2012-09-10 16:29:15
Tamaño: 579
Comentario:
Versión 8 con fecha 2012-09-10 21:07:37
Tamaño: 9201
Comentario:
Los textos eliminados se marcan así. Los textos añadidos se marcan así.
Línea 2: Línea 2:
La cámara anda joia :D.
La cámara CMOS DMK BUC2203 soporta los formatos Y800 (ByN) en resoluciones de 320*240/640*480/744*480. Las especificaciones se las puede encontrar en la pagina del fabricante( [[http://www.theimagingsource.com/en_US/products/cameras/usb-cmos-mono/dmk22auc03/|ImagingSource]]). 
La cámara anda joia :D  
La cámara CMOS DMK BUC2203 soporta los formatos Y800 (ByN) en resoluciones de 320*240/640*480/744*480. Las especificaciones se las puede encontrar en la pagina del fabricante( [[http://www.theimagingsource.com/en_US/products/cameras/usb-cmos-mono/dmk22auc03/|ImagingSource]]).

El driver de linux para la cámara es desarrollado por [[http://unicap-imaging.org/|Unicap]].

Este driver tiene el inconveniente de que, detecta la cámara como una cámara de color y no monocromo. Por ello va haber que aplicar un parche al código fuente. Dentro de los tipos de cámaras soportados por este driver, la BUC2203 se monta con el driver euvccam en espacio de usuario. Este driver es el que hay que modificar para que funcione.
Línea 6: Línea 12:
 * apt-get install bzr
 * mkdir unicap && cd unicap/
 * bzr clone lp:unicap
 {{{
 > apt-get install bzr
 > mkdir unicap && cd unicap/
 > bzr clone lp:unicap
}}}

Para hacer andar la cámara con este driver hay que realizar las siguientes modificaciones.
 * Aplicar el siguiente parche:
   {{{
      === modified file 'libunicap/cpi/euvccam/euvccam_devspec.c'
--- libunicap/cpi/euvccam/euvccam_devspec.c 2011-07-24 07:31:50 +0000
+++ libunicap/cpi/euvccam/euvccam_devspec.c 2012-09-10 20:23:57 +0000
@@ -266,6 +266,154 @@
       enumerate_func: NULL,
    },
 };
+static euvccam_property_t properties_8201_mono[] =
+{
+ {
+ {
+ identifier: "Shutter",
+ category: "Exposure",
+ unit: "s",
+ relations: NULL,
+ relations_count: 0,
+ {value: 0},
+ {range: { min: 0.0001, max: 0.25 } },
+ stepping: 0.0001,
+ type: UNICAP_PROPERTY_TYPE_RANGE,
+ flags: UNICAP_FLAGS_MANUAL,
+ flags_mask: UNICAP_FLAGS_MANUAL | UNICAP_FLAGS_AUTO,
+ property_data: NULL,
+ property_data_size: 0,
+ },
+
+ get_func: euvccam_device_get_exposure,
+ set_func: euvccam_device_set_exposure,
+ enumerate_func: NULL,
+ },
+ {
+ {
+ identifier: "Gain",
+ category: "Exposure",
+ unit: "",
+ relations: NULL,
+ relations_count: 0,
+ {value: 0},
+ {range: { min: 16, max: 63 } },
+ stepping: 1.0,
+ type: UNICAP_PROPERTY_TYPE_RANGE,
+ flags: UNICAP_FLAGS_MANUAL,
+ flags_mask: UNICAP_FLAGS_MANUAL | UNICAP_FLAGS_AUTO,
+ property_data: NULL,
+ property_data_size: 0,
+ },
+
+ get_func: euvccam_device_get_gain,
+ set_func: euvccam_device_set_gain,
+ enumerate_func: NULL,
+ },
+ {
+ {
+ identifier: "Frame Rate",
+ category: "Video",
+ unit: "",
+ relations: NULL,
+ relations_count: 0,
+ {value: 0},
+ {range: { min: 0, max: 0 } },
+ stepping: 1.0,
+ type: UNICAP_PROPERTY_TYPE_VALUE_LIST,
+ flags: UNICAP_FLAGS_MANUAL,
+ flags_mask: UNICAP_FLAGS_MANUAL,
+ property_data: NULL,
+ property_data_size: 0,
+ },
+
+ get_func: euvccam_device_get_frame_rate,
+ set_func: euvccam_device_set_frame_rate,
+ enumerate_func: euvccam_device_enumerate_frame_rate,
+ },
+ {
+ {
+ identifier: N_("trigger"),
+ category: N_("device"),
+ unit: "",
+ relations: NULL,
+ relations_count: 0,
+ {menu_item: TRIGGER_FREE_RUNNING},
+ {menu: { menu_items: trigger_menu,
+ menu_item_count: sizeof( trigger_menu ) / sizeof( char * ) } },
+ stepping: 0.0,
+ type: UNICAP_PROPERTY_TYPE_MENU,
+ flags: UNICAP_FLAGS_MANUAL,
+ flags_mask: UNICAP_FLAGS_MANUAL,
+ property_data: NULL,
+ property_data_size: 0
+ },
+
+ get_func: euvccam_device_get_trigger,
+ set_func: euvccam_device_set_trigger,
+ enumerate_func: euvccam_device_enumerate_trigger,
+ },
+ {
+ {
+ identifier: N_("software trigger"),
+ category: N_("device"),
+ unit: "",
+ relations: NULL,
+ relations_count: 0,
+ stepping: 0.0,
+ type: UNICAP_PROPERTY_TYPE_FLAGS,
+ flags: UNICAP_FLAGS_ONE_PUSH | UNICAP_FLAGS_MANUAL,
+ flags_mask: UNICAP_FLAGS_ONE_PUSH | UNICAP_FLAGS_MANUAL,
+ property_data: NULL,
+ property_data_size: 0
+ },
+
+ get_func: euvccam_device_get_software_trigger,
+ set_func: euvccam_device_set_software_trigger,
+ enumerate_func: euvccam_device_enumerate_software_trigger,
+ },
+#if 0
+ {
+ {
+ identifier: N_("reset sensor"),
+ category: N_("device"),
+ unit: "",
+ relations: NULL,
+ relations_count: 0,
+ stepping: 0.0,
+ type: UNICAP_PROPERTY_TYPE_FLAGS,
+ flags: UNICAP_FLAGS_ONE_PUSH | UNICAP_FLAGS_MANUAL,
+ flags_mask: UNICAP_FLAGS_ONE_PUSH | UNICAP_FLAGS_MANUAL,
+ property_data: NULL,
+ property_data_size: 0
+ },
+
+ get_func: euvccam_device_get_reset_mt9v024,
+ set_func: euvccam_device_set_reset_mt9v024,
+ },
+#endif
+ {
+ {
+ identifier: "IIC Command",
+ category: "Device",
+ unit: "",
+ relations: NULL,
+ relations_count: 0,
+ {value: 0},
+ {range: { min: 5, max: 120 } },
+ stepping: 1.0,
+ type: UNICAP_PROPERTY_TYPE_DATA,
+ flags: UNICAP_FLAGS_MANUAL,
+ flags_mask: UNICAP_FLAGS_MANUAL,
+ property_data: NULL,
+ property_data_size: 0,
+ },
+
+ get_func: euvccam_device_read_iic,
+ set_func: euvccam_device_write_iic,
+ enumerate_func: NULL,
+ },
+};
 
 static euvccam_property_t properties_8206[] =
 {
@@ -1166,6 +1314,89 @@
       
 };
 
+static double format_8201_mono_framerates[] = { 87, 60, 30, 25, 15, 7.5, 5};
+static int format_8201_mono_framerate_map[] = { 7, 6, 0, 1, 2, 3, 4};
+
+static struct euvccam_video_format_description formats_8201_mono[] =
+{
+ {
+ 1,
+ 3,
+ { identifier: "Y800 320x240",
+ size: {0,0,320,240},
+ min_size: { 0,0,320,240 },
+ max_size: { 0,0,320,240 },
+ h_stepping: 0,
+ v_stepping: 0,
+ sizes: NULL,
+ size_count: 0,
+ bpp: 8,
+ buffer_size: 320 * 240,
+ fourcc: FOURCC( 'Y', '8', '0', '0' ),
+ flags: 0,
+ buffer_types: UNICAP_BUFFER_TYPE_SYSTEM | UNICAP_BUFFER_TYPE_USER,
+ system_buffer_count: EUVCCAM_SYSTEM_BUFFER_COUNT,
+ buffer_type: 0
+ },
+ N_ELEMENTS( format_8201_mono_framerates ),
+ format_8201_mono_framerates,
+ format_8201_mono_framerate_map,
+ 320 * 240,
+ NULL,
+ EUVCCAM_FORMAT_IS_PARTIAL_SCAN,
+ },
+ {
+ 1,
+ 2,
+ { identifier: "Y800 640x480",
+ size: {0,0,640,480},
+ min_size: { 0,0,640,480 },
+ max_size: { 0,0,640,480 },
+ h_stepping: 0,
+ v_stepping: 0,
+ sizes: NULL,
+ size_count: 0,
+ bpp: 8,
+ buffer_size: 640 * 480,
+ fourcc: FOURCC( 'Y', '8', '0', '0' ),
+ flags: 0,
+ buffer_types: UNICAP_BUFFER_TYPE_SYSTEM | UNICAP_BUFFER_TYPE_USER,
+ system_buffer_count: EUVCCAM_SYSTEM_BUFFER_COUNT,
+ buffer_type: 0
+ },
+ N_ELEMENTS( format_8201_mono_framerates ),
+ format_8201_mono_framerates,
+ format_8201_mono_framerate_map,
+ 640 * 480,
+ NULL,
+ },
+ {
+ 1,
+ 1,
+ { identifier: "Y800 744x480",
+ size: {0,0,744,480},
+ min_size: { 0,0,744,480 },
+ max_size: { 0,0,744,480 },
+ h_stepping: 0,
+ v_stepping: 0,
+ sizes: NULL,
+ size_count: 0,
+ bpp: 8,
+ buffer_size: 744 * 480,
+ fourcc: FOURCC( 'Y', '8', '0', '0' ),
+ flags: 0,
+ buffer_types: UNICAP_BUFFER_TYPE_SYSTEM | UNICAP_BUFFER_TYPE_USER,
+ system_buffer_count: EUVCCAM_SYSTEM_BUFFER_COUNT,
+ buffer_type: 0
+ },
+ N_ELEMENTS( format_8201_mono_framerates ),
+ format_8201_mono_framerates,
+ format_8201_mono_framerate_map,
+ 744 * 480,
+ NULL,
+ },
+};
+
 
 static double format_8202_framerates[] = { 87, 60, 30, 25, 15, 7.5, 5};
 static int format_8202_framerate_map[] = { 7, 6, 0, 1, 2, 3, 4};
@@ -2147,14 +2378,24 @@
 
 struct euvccam_devspec euvccam_devspec[] =
 {
+ /*Lo que había originalmente*/
+ /*{*/
+ /*0x8201,*/
+ /*0, */
+ /*0,*/
+ /*N_ELEMENTS( formats_8201 ),*/
+ /*formats_8201,*/
+ /*N_ELEMENTS( properties_8201 ),*/
+ /*properties_8201,*/
+ /*},*/
    {
       0x8201,
       0,
       0,
- N_ELEMENTS( formats_8201 ),
- formats_8201,
- N_ELEMENTS( properties_8201 ),
- properties_8201,
+ N_ELEMENTS( formats_8201_mono ),
+ formats_8201_mono,
+ N_ELEMENTS( properties_8201_mono ),
+ properties_8202_mono,
    },
    {
       0x8202,

   }}}
 * para aplicar el parche creamos un archivo llamado "parcheBUC2203.patch" que contenga lo anterior y ejecutamos la siguiente instrucción.
 {{{
 > cd unicap/libunicap/
 > patch -p1 < /dondeestaelparche/parcheBUC2203.patch
 > ./configure
 > make
 > make install
}}}

 * Luego compilar e instalar libucil y libunicapgtk:
 {{{
 > cd unicap/libucil/
 > ./configure
 > make
 > make install
 > cd unicap/libunicapgtk
 > ./configure
 > make
 > make install
}}}

 * Para comprobar que la cámara funciona se puede compilar e instalar el programa ucview:
 {{{
 > bzr clone lp:ucview
 > cd ucview/trunk/ucview
 > ./configure
 > make
 > make install
}}}
 * Luego ejecutamos:
 {{{
 > ucview
}}}
 * Y debe andar :D ja

Instalación y uso de la cámara DMK BUC2203 en Debian

La cámara anda joia :D

La cámara CMOS DMK BUC2203 soporta los formatos Y800 (ByN) en resoluciones de 320*240/640*480/744*480. Las especificaciones se las puede encontrar en la pagina del fabricante( ImagingSource).

El driver de linux para la cámara es desarrollado por Unicap.

Este driver tiene el inconveniente de que, detecta la cámara como una cámara de color y no monocromo. Por ello va haber que aplicar un parche al código fuente. Dentro de los tipos de cámaras soportados por este driver, la BUC2203 se monta con el driver euvccam en espacio de usuario. Este driver es el que hay que modificar para que funcione.

El paso a paso

Hay que descargar los archivos fuentes del driver, una forma es haciendo un clon del repositorio bazar:

  •  > apt-get install bzr
     > mkdir unicap && cd unicap/
     > bzr clone lp:unicap 

Para hacer andar la cámara con este driver hay que realizar las siguientes modificaciones.

  • Aplicar el siguiente parche:
    •       === modified file 'libunicap/cpi/euvccam/euvccam_devspec.c'
      --- libunicap/cpi/euvccam/euvccam_devspec.c     2011-07-24 07:31:50 +0000
      +++ libunicap/cpi/euvccam/euvccam_devspec.c     2012-09-10 20:23:57 +0000
      @@ -266,6 +266,154 @@
             enumerate_func: NULL,
          },
       };
      +static euvccam_property_t properties_8201_mono[] =
      +{
      +   {
      +      {
      +       identifier: "Shutter", 
      +       category: "Exposure",
      +       unit: "s",
      +       relations: NULL,
      +       relations_count: 0, 
      +       {value: 0}, 
      +       {range: { min: 0.0001, max: 0.25 } },
      +       stepping: 0.0001,
      +       type: UNICAP_PROPERTY_TYPE_RANGE,
      +       flags: UNICAP_FLAGS_MANUAL,
      +       flags_mask: UNICAP_FLAGS_MANUAL | UNICAP_FLAGS_AUTO,
      +       property_data: NULL, 
      +       property_data_size: 0,
      +      },
      +      
      +      get_func: euvccam_device_get_exposure,
      +      set_func: euvccam_device_set_exposure,
      +      enumerate_func: NULL,
      +   },
      +   {
      +      {
      +       identifier: "Gain", 
      +       category: "Exposure",
      +       unit: "",
      +       relations: NULL,
      +       relations_count: 0, 
      +       {value: 0}, 
      +       {range: { min: 16, max: 63 } },
      +       stepping: 1.0,
      +       type: UNICAP_PROPERTY_TYPE_RANGE,
      +       flags: UNICAP_FLAGS_MANUAL,
      +       flags_mask: UNICAP_FLAGS_MANUAL | UNICAP_FLAGS_AUTO,
      +       property_data: NULL, 
      +       property_data_size: 0,
      +      },
      +      
      +      get_func: euvccam_device_get_gain,
      +      set_func: euvccam_device_set_gain,
      +      enumerate_func: NULL,
      +   },
      +   {
      +      {
      +       identifier: "Frame Rate",
      +       category: "Video",
      +       unit: "",
      +       relations: NULL,
      +       relations_count: 0,
      +       {value: 0},
      +       {range: { min: 0, max: 0 } },
      +       stepping: 1.0,
      +       type: UNICAP_PROPERTY_TYPE_VALUE_LIST,
      +       flags: UNICAP_FLAGS_MANUAL,
      +       flags_mask: UNICAP_FLAGS_MANUAL,
      +       property_data: NULL,
      +       property_data_size: 0,
      +      },
      +      
      +      get_func: euvccam_device_get_frame_rate,
      +      set_func: euvccam_device_set_frame_rate,
      +      enumerate_func: euvccam_device_enumerate_frame_rate,
      +   },
      +   {
      +      {
      +       identifier: N_("trigger"),
      +       category: N_("device"),
      +       unit: "",
      +       relations: NULL,
      +       relations_count: 0,
      +       {menu_item: TRIGGER_FREE_RUNNING},
      +       {menu: { menu_items: trigger_menu, 
      +                menu_item_count: sizeof( trigger_menu ) / sizeof( char * ) } },
      +       stepping: 0.0,
      +       type: UNICAP_PROPERTY_TYPE_MENU,
      +       flags: UNICAP_FLAGS_MANUAL,
      +       flags_mask: UNICAP_FLAGS_MANUAL,
      +       property_data: NULL,
      +       property_data_size: 0
      +      },
      +      
      +      get_func: euvccam_device_get_trigger,
      +      set_func: euvccam_device_set_trigger,
      +      enumerate_func: euvccam_device_enumerate_trigger,
      +   },
      +   {
      +      {
      +       identifier: N_("software trigger"),
      +       category: N_("device"),
      +       unit: "",
      +       relations: NULL,
      +       relations_count: 0,
      +       stepping: 0.0,
      +       type: UNICAP_PROPERTY_TYPE_FLAGS,
      +       flags: UNICAP_FLAGS_ONE_PUSH | UNICAP_FLAGS_MANUAL,
      +       flags_mask: UNICAP_FLAGS_ONE_PUSH | UNICAP_FLAGS_MANUAL,
      +       property_data: NULL,
      +       property_data_size: 0
      +      },
      +      
      +      get_func: euvccam_device_get_software_trigger,
      +      set_func: euvccam_device_set_software_trigger,
      +      enumerate_func: euvccam_device_enumerate_software_trigger,
      +   },
      +#if 0
      +   {
      +      {
      +       identifier: N_("reset sensor"),
      +       category: N_("device"),
      +       unit: "",
      +       relations: NULL,
      +       relations_count: 0,
      +       stepping: 0.0,
      +       type: UNICAP_PROPERTY_TYPE_FLAGS,
      +       flags: UNICAP_FLAGS_ONE_PUSH | UNICAP_FLAGS_MANUAL,
      +       flags_mask: UNICAP_FLAGS_ONE_PUSH | UNICAP_FLAGS_MANUAL,
      +       property_data: NULL,
      +       property_data_size: 0
      +      },
      +      
      +      get_func: euvccam_device_get_reset_mt9v024,
      +      set_func: euvccam_device_set_reset_mt9v024,
      +   },
      +#endif
      +   {
      +      {
      +       identifier: "IIC Command", 
      +       category: "Device",
      +       unit: "",
      +       relations: NULL,
      +       relations_count: 0, 
      +       {value: 0}, 
      +       {range: { min: 5, max: 120 } },
      +       stepping: 1.0,
      +       type: UNICAP_PROPERTY_TYPE_DATA,
      +       flags: UNICAP_FLAGS_MANUAL,
      +       flags_mask: UNICAP_FLAGS_MANUAL,
      +       property_data: NULL, 
      +       property_data_size: 0,
      +      },
      +      
      +      get_func: euvccam_device_read_iic,
      +      set_func: euvccam_device_write_iic,
      +      enumerate_func: NULL,
      +   },
      +};
       
       static euvccam_property_t properties_8206[] =
       {
      @@ -1166,6 +1314,89 @@
             
       };
       
      +static double format_8201_mono_framerates[] = {   87, 60, 30, 25, 15, 7.5, 5};
      +static int    format_8201_mono_framerate_map[] = { 7, 6,  0,  1,  2,   3, 4};
      +
      +static struct euvccam_video_format_description formats_8201_mono[] =
      +{
      +   {
      +      1,
      +      3,
      +      { identifier: "Y800 320x240",
      +       size: {0,0,320,240},
      +       min_size: { 0,0,320,240 },
      +       max_size: { 0,0,320,240 },
      +       h_stepping: 0,
      +       v_stepping: 0, 
      +       sizes: NULL,
      +       size_count: 0,
      +       bpp: 8,
      +       buffer_size: 320 * 240,
      +       fourcc: FOURCC( 'Y', '8', '0', '0' ),
      +       flags: 0, 
      +       buffer_types: UNICAP_BUFFER_TYPE_SYSTEM | UNICAP_BUFFER_TYPE_USER, 
      +       system_buffer_count: EUVCCAM_SYSTEM_BUFFER_COUNT,
      +       buffer_type: 0
      +      },
      +      N_ELEMENTS( format_8201_mono_framerates ), 
      +      format_8201_mono_framerates,
      +      format_8201_mono_framerate_map,
      +      320 * 240, 
      +      NULL, 
      +      EUVCCAM_FORMAT_IS_PARTIAL_SCAN,
      +   },
      +   {
      +      1,
      +      2,
      +      { identifier: "Y800 640x480",
      +       size: {0,0,640,480},
      +       min_size: { 0,0,640,480 },
      +       max_size: { 0,0,640,480 },
      +       h_stepping: 0,
      +       v_stepping: 0, 
      +       sizes: NULL,
      +       size_count: 0,
      +       bpp: 8,
      +       buffer_size: 640 * 480,
      +       fourcc: FOURCC( 'Y', '8', '0', '0' ),
      +       flags: 0, 
      +       buffer_types: UNICAP_BUFFER_TYPE_SYSTEM | UNICAP_BUFFER_TYPE_USER, 
      +       system_buffer_count: EUVCCAM_SYSTEM_BUFFER_COUNT,
      +       buffer_type: 0
      +      },
      +      N_ELEMENTS( format_8201_mono_framerates ), 
      +      format_8201_mono_framerates,
      +      format_8201_mono_framerate_map,
      +      640 * 480, 
      +      NULL,
      +   },
      +   {
      +      1,
      +      1,
      +      { identifier: "Y800 744x480",
      +       size: {0,0,744,480},
      +       min_size: { 0,0,744,480 },
      +       max_size: { 0,0,744,480 },
      +       h_stepping: 0,
      +       v_stepping: 0, 
      +       sizes: NULL,
      +       size_count: 0,
      +       bpp: 8,
      +       buffer_size: 744 * 480,
      +       fourcc: FOURCC( 'Y', '8', '0', '0' ),
      +       flags: 0, 
      +       buffer_types: UNICAP_BUFFER_TYPE_SYSTEM | UNICAP_BUFFER_TYPE_USER, 
      +       system_buffer_count: EUVCCAM_SYSTEM_BUFFER_COUNT,
      +       buffer_type: 0
      +      },
      +      N_ELEMENTS( format_8201_mono_framerates ), 
      +      format_8201_mono_framerates,
      +      format_8201_mono_framerate_map,
      +     744 * 480, 
      +      NULL, 
      +   },
      +};
      +
       
       static double format_8202_framerates[] = {   87, 60, 30, 25, 15, 7.5, 5};
       static int    format_8202_framerate_map[] = { 7, 6,  0,  1,  2,   3, 4};
      @@ -2147,14 +2378,24 @@
       
       struct euvccam_devspec euvccam_devspec[] =
       {
      +    /*Lo que había originalmente*/
      +   /*{*/
      +      /*0x8201,*/
      +      /*0, */
      +      /*0,*/
      +      /*N_ELEMENTS( formats_8201 ),*/
      +      /*formats_8201,*/
      +      /*N_ELEMENTS( properties_8201 ),*/
      +      /*properties_8201,*/
      +   /*},*/
          { 
             0x8201,
             0, 
             0,
      -      N_ELEMENTS( formats_8201 ),
      -      formats_8201, 
      -      N_ELEMENTS( properties_8201 ),
      -      properties_8201,
      +      N_ELEMENTS( formats_8201_mono ),
      +      formats_8201_mono, 
      +      N_ELEMENTS( properties_8201_mono ),
      +      properties_8202_mono,
          },
          {
             0x8202,
  • para aplicar el parche creamos un archivo llamado "parcheBUC2203.patch" que contenga lo anterior y ejecutamos la siguiente instrucción.
     > cd unicap/libunicap/
     > patch -p1 < /dondeestaelparche/parcheBUC2203.patch
     > ./configure 
     > make 
     > make install
  • Luego compilar e instalar libucil y libunicapgtk:
     > cd unicap/libucil/
     > ./configure
     > make 
     > make install
     > cd unicap/libunicapgtk
     > ./configure 
     > make 
     > make install
  • Para comprobar que la cámara funciona se puede compilar e instalar el programa ucview:
     > bzr clone lp:ucview 
     > cd ucview/trunk/ucview
     > ./configure
     > make
     > make install
  • Luego ejecutamos:
     > ucview
  • Y debe andar :D ja

None: HowTo/BUC2203LinuxInst (última edición 2014-08-06 17:33:27 efectuada por GastonAraguas)