|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
22 "yarp.carrier.portmonitor.depthimage",
57 yCError(DEPTHIMAGE,
"DepthImageConverter: expected type FlexImage but got wrong data type!");
67 "DepthImageConverter: expected %s, got %s, not doing any conversion!",
76 inMatrix =
reinterpret_cast<float **
> (img->getRawImage());
79 outImg.setPixelSize(1);
80 outImg.resize(img->width(), img->height());
83 auto* inPixels =
reinterpret_cast<float *
> (img->getRawImage());
84 unsigned char *pixels = outImg.getRawImage();
85 for(
size_t h=0; h<img->height(); h++)
87 for(
size_t w=0; w<img->width(); w++)
89 float inVal = inPixels[w + (h * img->width())];
90 if (inVal != inVal || inVal < min || inVal > max) {
91 pixels[w + (h * (img->width() ))] = 0;
93 int val = (int) (255.0 - (inVal * 255.0 / (max - min)));
98 pixels[w + (h * (img->width() ))] = (char) val;
102 th.setPortWriter(&outImg);
void setPixelCode(int imgPixelCode)
bool create(const yarp::os::Property &options) override
This will be called when the dll is properly loaded by the portmonitor carrier.
#define YARP_LOG_COMPONENT(name,...)
Base class for generic things.
std::string decode(NetInt32 code)
Convert a vocabulary identifier into a string.
bool setparam(const yarp::os::Property ¶ms) override
This will be called when the portmonitor carrier parameters are set via Yarp admin port.
static LogType minimumPrintLevel()
Get current minimum print level.
bool accept(yarp::os::Things &thing) override
This will be called when the data reach the portmonitor object.
#define yCError(component,...)
yarp::os::Things & update(yarp::os::Things &thing) override
After data get accpeted in the accept() callback, an instance of that is given to the update function...
bool getparam(yarp::os::Property ¶ms) override
This will be called when the portmonitor carrier parameters are requested via Yarp admin port.
An interface to the operating system, including Port based communication.
Base class for storing images.
static LogCallback printCallback()
Get current print callback.
void destroy() override
This will be called when the portmonitor object destroyes.
A class for storing options and configuration information.