/* version 1.0 */

#ifndef IMG_VISION_IDL
#define IMG_VISION_IDL

#include <BasicDataType.idl>

module RTC {

/* vector and matrix type */
typedef double Vec3[3];
typedef double Mat44[4][4];

/* image */
enum ColorFormat
{
  CF_UNKNOWN, CF_GRAY, CF_RGB
};

struct ImageData
{
  long width;
  long height;

  ColorFormat format;
  sequence<octet> raw_data;
};


/* camera image */
struct CameraIntrinsicParameter
{
  double matrix_element[5];
  sequence<double> distortion_coefficient;
};

struct CameraImage
{
  RTC::Time captured_time;
  ImageData image;
  CameraIntrinsicParameter intrinsic;
  Mat44 extrinsic;
};

struct TimedCameraImage
{
  RTC::Time tm;
  CameraImage data;
  long error_code;
};


/* stereo camera image */
struct MultiCameraImage
{
  sequence<CameraImage> image_seq;
  long camera_set_id;
};

struct TimedMultiCameraImage
{
  RTC::Time tm;
  MultiCameraImage data;
  long error_code;
};


/* point cloud */
struct PointCloud
{
  long id;
  RTC::Mat44 T;

  sequence<RTC::Vec3> point;
  sequence<RTC::Vec3> color;
};

struct TimedPointCloud
{
  RTC::Time tm;
  PointCloud data;
  long error_code;
};


/* reconstructed 3D data by stereo vision */
struct Stereo3D
{
  TimedPointCloud obj;
  RTC::TimedMultiCameraImage mimg;
};

struct TimedStereo3D
{
  RTC::Time tm;
  Stereo3D data;
  long error_code;
};


/* result of localization */
/*
  TimedRecognitionResult:
  Camera Set ID, Object ID, Candidate No., Coordinate system No.,
  Recognition reliability, Error No., Reserve 1, Reserve 2,
  r000, r001, r002, t0x,
  r010, r011, r012, t0y,
  r020, r021, r022, t0z,
  Camera ID...
 */

typedef RTC::TimedDoubleSeq TimedRecognitionResult;

}; /* module */

#endif /* IMG_VISION_IDL */
