source: pacpussensors/trunk/Vislab/VislabImageProcessor.cpp@ 137

Last change on this file since 137 was 132, checked in by ldecherf, 8 years ago

Ajout de la doc

File size: 1.4 KB
Line 
1#include "VislabImageProcessor.h"
2
3
4 VislabImageProcessor::VislabImageProcessor(const QString& name, lib3dv::image::type::types imageType)
5 :mImageType(imageType), mName(name)
6 {
7 }
8
9 void VislabImageProcessor::image_callback(boost::shared_ptr< const lib3dv::image> image, unsigned int)
10 {
11 if(image->m_type == mImageType)
12 {
13 /*! Type picture : Mono 8 */
14 if(image->m_format == lib3dv::image::format::MONO8)
15 {
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);
18 /*for(int i=0;i<image->m_height*image->m_width;i++)
19 {
20 cvimage.data[i] = image->m_buffer[i];
21 }*/
22 process(cvimage);
23 }
24
25 /*! Type picture : Mono 16 */
26 if(image->m_format == lib3dv::image::format::MONO16)
27 {
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);
30 /**for(int i=0;i<image->m_height*image->m_width*2;i++)
31 {
32 cvimage.data[i] = image->m_buffer[i];
33 }*/
34 process(cvimage);
35 }
36 }
37 }
38
39 QString VislabImageProcessor::getName()
40 {
41 return mName;
42 }
43
44
45
46
Note: See TracBrowser for help on using the repository browser.