From e73831e98bfe13a03dfbac9653aaca290c7d41e9 Mon Sep 17 00:00:00 2001 From: asantamaria <asantamaria@iri.upc.edu> Date: Wed, 14 Dec 2016 00:42:53 +0100 Subject: [PATCH] working with opencv3.0 and ROS. first draft --- src/mvbluefox3.cpp | 18 +++++++++--------- src/mvbluefox3.h | 21 ++++++--------------- 2 files changed, 15 insertions(+), 24 deletions(-) diff --git a/src/mvbluefox3.cpp b/src/mvbluefox3.cpp index bfbe721..86cc000 100644 --- a/src/mvbluefox3.cpp +++ b/src/mvbluefox3.cpp @@ -32,6 +32,7 @@ CMvbluefox3::CMvbluefox3(const std::string &serial) // Initialize other vars this->timeout_ms_ = -1; + this->linepitch_ = 8; this->depth_ = 8; this->bytes_per_pixel_ = 1; @@ -220,6 +221,7 @@ void CMvbluefox3::GetImageCV(cv::Mat &image) int type = CV_8UC1; switch (this->depth_*this->bytes_per_pixel_) + switch (this->linepitch_) { case 8: type = CV_8UC1; break; case 16: type = CV_8UC2; break; @@ -252,6 +254,9 @@ void CMvbluefox3::GetImageReqFormat(mvIMPACT::acquire::Request *request) // 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 TBayerMosaicParity bayer_mosaic_parity; ReadProperty(request_->imageBayerMosaicParity,bayer_mosaic_parity); @@ -263,17 +268,12 @@ void CMvbluefox3::GetImageReqFormat(mvIMPACT::acquire::Request *request) } else // Bayer pattern 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_; -} - -int CMvbluefox3::GetBytesXPixel(void) -{ - return this->bytes_per_pixel_; + return this->linepitch_; } int CMvbluefox3::ReqExposeUs(void) @@ -586,7 +586,7 @@ void CMvbluefox3::SetHdr(bool &hdr) void CMvbluefox3::SetDarkCFilter(int &dcfm) { 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{ diff --git a/src/mvbluefox3.h b/src/mvbluefox3.h index 5ad0d11..3f86e7f 100644 --- a/src/mvbluefox3.h +++ b/src/mvbluefox3.h @@ -44,7 +44,6 @@ private: // Acquisition frame_rate = 100000; - frate_limit_mode = 0; pixel_clock = 66000; req_timeout = 2000; @@ -87,7 +86,6 @@ public: int v_binning; // Vertical binning factor. int frame_rate; // Frame rate. - int frate_limit_mode; // Calculation of the maximum frame rate. int pixel_clock; // Pixel_clock. int req_timeout; // request timeout [ms]. @@ -144,13 +142,13 @@ class CMvbluefox3 mvIMPACT::acquire::GenICam::LUTControl *lut_ctrl_; // LUT. 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 bytes_per_pixel_; // Bytes per pixel. - /** * \brief Mutex object to handle the access to the image * @@ -431,18 +429,11 @@ class CMvbluefox3 CParams GetConfig(void); /** - * \brief Get channel's depth - * - * Get channel's depth. - */ - int GetChDepth(void); - - /** - * \brief Get bytes-pixel + * \brief Get line pitch * - * Get bytes-pixel. + * Get line pitch. */ - int GetBytesXPixel(void); + int GetImgLinePitch(void); }; -- GitLab