Changeset 142 in pacpussensors for trunk/Vislab/VislabImageProcessor.cpp


Ignore:
Timestamp:
03/30/17 16:18:32 (7 years ago)
Author:
ldecherf
Message:

Ajout de la classe outputter et modification d'openCV

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Vislab/VislabImageProcessor.cpp

    r132 r142  
    11#include "VislabImageProcessor.h"
     2
     3#include <opencv2/opencv.hpp>
     4#include <opencv2/highgui.hpp>
    25
    36
     
    710    }
    811
    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)
    1013    {
    11         if(image->m_type == mImageType)
     14        if(image->type() == mImageType)
    1215        {
    1316            /*! Type picture : Mono 8 */
    14             if(image->m_format == lib3dv::image::format::MONO8)
     17            if(image->format() == lib3dv::image::format::MONO8)
    1518            {
    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());
    1821                /*for(int i=0;i<image->m_height*image->m_width;i++)
    1922                {
     
    2427
    2528            /*! Type picture : Mono 16 */
    26             if(image->m_format == lib3dv::image::format::MONO16)
     29            if(image->format() == lib3dv::image::format::MONO16)
    2730            {
    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);
    3033                /**for(int i=0;i<image->m_height*image->m_width*2;i++)
    3134                {
Note: See TracChangeset for help on using the changeset viewer.