fixstars / ion-kit

Modernized graph-based data processing framework
MIT License
7 stars 6 forks source link

Add aravis fake camera on U3V class #166

Closed Fixstars-momoko closed 7 months ago

Fixstars-momoko commented 10 months ago

https://aravisproject.github.io/docs/aravis-0.8/ch08.html

xinyuli1204 commented 7 months ago

export GENICAM_FILENAME=/home/xinyu.li/dependency/ion-kit/arv-fake-camera.xml ./u3v_fake_jit

xinyuli1204 commented 7 months ago

https://github.com/fixstars/ion-kit/pull/244

xinyuli1204 commented 7 months ago

Note

please ensure you export GENICAM_FILENAME=<path-to-arv-fake-camera.xml> orset GENICAM_FILENAME=<path-to-arv-fake-camera.xml> before usingimage_io_u3v_camera_fake\ building block

Original arv-fake-camera.xml can be download at https://github.com/Sensing-Dev/aravis/blob/main/src/arv-fake-camera.xml

You can also create your fake-camera.xml by editing original xml file and `export GENICAM_FILENAME=

xinyuli1204 commented 7 months ago

Note

please ensure you export GENICAM_FILENAME=<path-to-arv-fake-camera.xml> orset GENICAM_FILENAME=<path-to-arv-fake-camera.xml> before usingimage_io_u3v_camera_fake\ building block

Original arv-fake-camera.xml can be download at https://github.com/Sensing-Dev/aravis/blob/main/src/arv-fake-camera.xml

You can also create your fake-camera.xml by editing original xml file and `export GENICAM_FILENAME=

@Fixstars-momoko some notes to use fake camera

xinyuli1204 commented 7 months ago

add BuildingBlockParam<bool> force_sim_mode{"force_sim_mode", false}; in U3VCameraN if set to true, U3VCameraN begin simulation U3VCameraN can also fallback to simulation modeif there is no device found on the host

 unsigned int n_devices = arv_get_n_devices ();
  if (n_devices == 0){
      log::warn("Fallback to simulation mode: Could not find camera");
      sim_mode_ = true;
  }
xinyuli1204 commented 7 months ago
        int width = 960;
        int height = 640;
        int num_device = 2;
        Node n = b.add("image_io_u3v_cameraN_u8x2")().set_param(
        Param("num_devices", num_device),
        Param("force_sim_mode", true),
        Param("width", width),
        Param("height", height),
        Param("fps", 30)
        );

/********************RGB 8*************************/
      Node n = b.add("image_io_u3v_cameraN_u8x3")().set_param(
              Param("num_devices", num_device),
              Param("pixel_format", "RGB8"));

/********************Mono16*************************/
      Node n = b.add("image_io_u3v_cameraN_u16x2")().set_param(
              Param("num_devices", num_device),
              Param("pixel_format", "Mono16"));
xinyuli1204 commented 7 months ago

https://github.com/fixstars/ion-kit/pull/244