Changeset 142 in pacpussensors for trunk/Vislab/VislabImageProcessor.cpp
- Timestamp:
- Mar 30, 2017, 4:18:32 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Vislab/VislabImageProcessor.cpp
r132 r142 1 1 #include "VislabImageProcessor.h" 2 3 #include <opencv2/opencv.hpp> 4 #include <opencv2/highgui.hpp> 2 5 3 6 … … 7 10 } 8 11 9 void VislabImageProcessor::image_callback(boost::shared_ptr< const lib3dv::image> image , unsigned int)12 void VislabImageProcessor::image_callback(boost::shared_ptr< const lib3dv::image> image) 10 13 { 11 if(image-> m_type== mImageType)14 if(image->type() == mImageType) 12 15 { 13 16 /*! Type picture : Mono 8 */ 14 if(image-> m_format== lib3dv::image::format::MONO8)17 if(image->format() == lib3dv::image::format::MONO8) 15 18 { 16 cv::Mat cvimage(image-> m_height, image->m_width, CV_8UC1);17 std::memcpy(cvimage.data,image-> m_buffer.data(),image->m_height*image->m_width);19 cv::Mat cvimage(image->height(), image->width(), CV_8UC1); 20 std::memcpy(cvimage.data,image->data(),image->height()*image->width()); 18 21 /*for(int i=0;i<image->m_height*image->m_width;i++) 19 22 { … … 24 27 25 28 /*! Type picture : Mono 16 */ 26 if(image-> m_format== lib3dv::image::format::MONO16)29 if(image->format() == lib3dv::image::format::MONO16) 27 30 { 28 cv::Mat cvimage(image-> m_height, image->m_width, CV_16UC1);29 std::memcpy(cvimage.data,image-> m_buffer.data(),image->m_height*image->m_width*2);31 cv::Mat cvimage(image->height(), image->width(), CV_16UC1); 32 std::memcpy(cvimage.data,image->data(),image->height()*image->width()*2); 30 33 /**for(int i=0;i<image->m_height*image->m_width*2;i++) 31 34 {
Note:
See TracChangeset
for help on using the changeset viewer.