Skip to content

Commit

Permalink
yarpdataplayer: port to OpenCV4
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicogene committed Jan 3, 2020
1 parent f0487e8 commit d29132c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/yarpdataplayer/src/worker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
#include "include/worker.h"
#include "include/mainwindow.h"
#include "include/log.h"
#if CV_MAJOR_VERSION >= 3
#include <opencv2/imgcodecs/imgcodecs.hpp>
#endif

using namespace yarp::sig;
using namespace yarp::sig::file;
Expand Down Expand Up @@ -181,7 +184,11 @@ int WorkerClass::sendImages(int part, int frame)
fileValid = read(*static_cast<ImageOf<PixelFloat>*>(img_yarp.get()),tmpPath);
}
else {
#if CV_MAJOR_VERSION >= 3
cv_img = cv::imread(tmpPath, cv::ImreadModes::IMREAD_UNCHANGED);
#else
cv_img = cv::imread(tmpPath, CV_LOAD_IMAGE_UNCHANGED);
#endif
if ( cv_img.data != nullptr ) {
if (code==VOCAB_PIXEL_RGB)
{
Expand Down

0 comments on commit d29132c

Please sign in to comment.