Skip to content
Snippets Groups Projects
Commit e73831e9 authored by Angel Santamaria-Navarro's avatar Angel Santamaria-Navarro
Browse files

working with opencv3.0 and ROS. first draft

parent b46e3bd2
No related branches found
No related tags found
No related merge requests found
...@@ -32,6 +32,7 @@ CMvbluefox3::CMvbluefox3(const std::string &serial) ...@@ -32,6 +32,7 @@ CMvbluefox3::CMvbluefox3(const std::string &serial)
// Initialize other vars // Initialize other vars
this->timeout_ms_ = -1; this->timeout_ms_ = -1;
this->linepitch_ = 8;
this->depth_ = 8; this->depth_ = 8;
this->bytes_per_pixel_ = 1; this->bytes_per_pixel_ = 1;
...@@ -220,6 +221,7 @@ void CMvbluefox3::GetImageCV(cv::Mat &image) ...@@ -220,6 +221,7 @@ void CMvbluefox3::GetImageCV(cv::Mat &image)
int type = CV_8UC1; int type = CV_8UC1;
switch (this->depth_*this->bytes_per_pixel_) switch (this->depth_*this->bytes_per_pixel_)
switch (this->linepitch_)
{ {
case 8: type = CV_8UC1; break; case 8: type = CV_8UC1; break;
case 16: type = CV_8UC2; break; case 16: type = CV_8UC2; break;
...@@ -252,6 +254,9 @@ void CMvbluefox3::GetImageReqFormat(mvIMPACT::acquire::Request *request) ...@@ -252,6 +254,9 @@ void CMvbluefox3::GetImageReqFormat(mvIMPACT::acquire::Request *request)
// Bytes per pixel // Bytes per pixel
ReadProperty(this->request_->imageBytesPerPixel,this->bytes_per_pixel_); ReadProperty(this->request_->imageBytesPerPixel,this->bytes_per_pixel_);
// Line pitch
ReadProperty(this->request_->imageLinePitch,this->linepitch_);
// Bayer parity of this image if this buffer is part of a larger image // Bayer parity of this image if this buffer is part of a larger image
TBayerMosaicParity bayer_mosaic_parity; TBayerMosaicParity bayer_mosaic_parity;
ReadProperty(request_->imageBayerMosaicParity,bayer_mosaic_parity); ReadProperty(request_->imageBayerMosaicParity,bayer_mosaic_parity);
...@@ -263,17 +268,12 @@ void CMvbluefox3::GetImageReqFormat(mvIMPACT::acquire::Request *request) ...@@ -263,17 +268,12 @@ void CMvbluefox3::GetImageReqFormat(mvIMPACT::acquire::Request *request)
} }
else // Bayer pattern else // Bayer pattern
this->params_.pixel_format = BayerPatternToEncoding(bayer_mosaic_parity, this->params_.pixel_format = BayerPatternToEncoding(bayer_mosaic_parity,
this->bytes_per_pixel_); this->bytes_per_pixel_);
} }
int CMvbluefox3::GetChDepth(void) int CMvbluefox3::GetImgLinePitch(void)
{ {
return this->depth_; return this->linepitch_;
}
int CMvbluefox3::GetBytesXPixel(void)
{
return this->bytes_per_pixel_;
} }
int CMvbluefox3::ReqExposeUs(void) int CMvbluefox3::ReqExposeUs(void)
...@@ -586,7 +586,7 @@ void CMvbluefox3::SetHdr(bool &hdr) ...@@ -586,7 +586,7 @@ void CMvbluefox3::SetHdr(bool &hdr)
void CMvbluefox3::SetDarkCFilter(int &dcfm) void CMvbluefox3::SetDarkCFilter(int &dcfm)
{ {
if (dcfm != dcfmOff && !this->bf_sets_->imageProcessing.darkCurrentFilterMode.isValid()) if (dcfm != dcfmOff && !this->bf_sets_->imageProcessing.darkCurrentFilterMode.isValid())
throw CmvBlueFOX3Exception(_HERE_, "HDR option is not available for this model."); throw CmvBlueFOX3Exception(_HERE_, "Dark filter option is not available for this model.");
try{ try{
......
...@@ -44,7 +44,6 @@ private: ...@@ -44,7 +44,6 @@ private:
// Acquisition // Acquisition
frame_rate = 100000; frame_rate = 100000;
frate_limit_mode = 0;
pixel_clock = 66000; pixel_clock = 66000;
req_timeout = 2000; req_timeout = 2000;
...@@ -87,7 +86,6 @@ public: ...@@ -87,7 +86,6 @@ public:
int v_binning; // Vertical binning factor. int v_binning; // Vertical binning factor.
int frame_rate; // Frame rate. int frame_rate; // Frame rate.
int frate_limit_mode; // Calculation of the maximum frame rate.
int pixel_clock; // Pixel_clock. int pixel_clock; // Pixel_clock.
int req_timeout; // request timeout [ms]. int req_timeout; // request timeout [ms].
...@@ -144,13 +142,13 @@ class CMvbluefox3 ...@@ -144,13 +142,13 @@ class CMvbluefox3
mvIMPACT::acquire::GenICam::LUTControl *lut_ctrl_; // LUT. mvIMPACT::acquire::GenICam::LUTControl *lut_ctrl_; // LUT.
mvIMPACT::acquire::Statistics *stats_; // Statistics. mvIMPACT::acquire::Statistics *stats_; // Statistics.
int timeout_ms_; // Frame request timeout. int timeout_ms_; // Frame request timeout.
codings_t coding_; // Image coding. codings_t coding_; // Image coding.
int linepitch_; // Line pitch.
int depth_; // Bits per image channel. int depth_; // Bits per image channel.
int bytes_per_pixel_; // Bytes per pixel. int bytes_per_pixel_; // Bytes per pixel.
/** /**
* \brief Mutex object to handle the access to the image * \brief Mutex object to handle the access to the image
* *
...@@ -431,18 +429,11 @@ class CMvbluefox3 ...@@ -431,18 +429,11 @@ class CMvbluefox3
CParams GetConfig(void); CParams GetConfig(void);
/** /**
* \brief Get channel's depth * \brief Get line pitch
*
* Get channel's depth.
*/
int GetChDepth(void);
/**
* \brief Get bytes-pixel
* *
* Get bytes-pixel. * Get line pitch.
*/ */
int GetBytesXPixel(void); int GetImgLinePitch(void);
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment