Commit c453395f authored by Éric Thiébaut's avatar Éric Thiébaut
Browse files

Introduce pre-processing level

parent c5758155
......@@ -143,7 +143,7 @@ void tao_camera_info_initialize(
info->config.buffers = 4;
info->config.framerate = 25.0; // 25 Hz
info->config.exposuretime = 0.001; // 1 ms
info->config.weighted = false;
info->config.preprocessing = TAO_PREPROCESSING_NONE;
info->state = TAO_STATE_INITIALIZING;
info->temperature = NAN;
get_monotonic_time(&info->origin);
......
......@@ -121,7 +121,7 @@ static tao_shared_array* allocate_frame(
unsigned flags)
{
tao_shared_array* arr;
if (cam->info.config.weighted == false) {
if (cam->info.config.preprocessing == TAO_PREPROCESSING_FULL) {
arr = tao_shared_array_create_2d(cam->info.config.pixeltype,
cam->info.config.roi.width,
cam->info.config.roi.height,
......@@ -148,7 +148,7 @@ static inline int is_suitable(
arr->eltype == cam->info.config.pixeltype &&
arr->dims[0] == cam->info.config.roi.width &&
arr->dims[1] == cam->info.config.roi.height &&
(cam->info.config.weighted
(cam->info.config.preprocessing == TAO_PREPROCESSING_FULL
? (arr->ndims == 3 && arr->dims[2] == 2)
: (arr->ndims == 2)));
}
......
......@@ -37,6 +37,16 @@ typedef struct tao_shared_camera_ tao_shared_camera;
* @{
*/
/**
* @brief Level of image pre-processing.
*/
typedef enum tao_preprocessing_ {
TAO_PREPROCESSING_NONE = 0,///< Just convert pixel values.
TAO_PREPROCESSING_AFFINE = 1,///< Apply affine correction.
TAO_PREPROCESSING_FULL = 2 ///< Apply affine correction and compute
/// weights.
} tao_preprocessing;
/**
* Region of interest on a camera.
*/
......@@ -145,16 +155,16 @@ typedef unsigned int tao_event;
* kind of camera.
*/
typedef struct tao_camera_config_ {
tao_camera_roi roi;///< Region of interest on the detector.
tao_eltype pixeltype;///< Pixel type in pre-processed images.
tao_encoding sensorencoding;///< Pixel encoding in images acquired by the
/// sensor.
tao_encoding bufferencoding;///< Pixel encoding for acquisition buffers.
long buffers;///< Number of acquisition buffers.
double framerate;///< Acquisition rate in frames per second.
double exposuretime;///< Exposure time in seconds.
int weighted;///< True if pre-processed images have
/// associated weights.
tao_camera_roi roi;///< Region of interest on the detector.
tao_eltype pixeltype;///< Pixel type in pre-processed images.
tao_encoding sensorencoding;///< Pixel encoding in images acquired by
/// the sensor.
tao_encoding bufferencoding;///< Pixel encoding for acquisition
/// buffers.
long buffers;///< Number of acquisition buffers.
double framerate;///< Acquisition rate in frames per second.
double exposuretime;///< Exposure time in seconds.
tao_preprocessing preprocessing;///< Level of image pre-processing.
} tao_camera_config;
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment