本文整理汇总了C++中DataManager::setOutputData方法的典型用法代码示例。如果您正苦于以下问题:C++ DataManager::setOutputData方法的具体用法?C++ DataManager::setOutputData怎么用?C++ DataManager::setOutputData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataManager
的用法示例。
在下文中一共展示了DataManager::setOutputData方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: run
/*
data DataManager handles the input and ouput of this module
*/
void AddListItemModule::run( DataManager& data) const
{
using namespace cv;
// select input list dependend on the type
if (data.hasInputData("stringList") || data.hasInputData("string")) {
data.setOutputData("stringList", addItemToList<String, string>(data, "stringList", "string"));
}
if (data.hasInputData("integerList") || data.hasInputData("integer")) {
data.setOutputData("integerList", addItemToList<Integer, int>(data, "integerList", "integer"));
}
if (data.hasInputData("floatList") || data.hasInputData("float")) {
data.setOutputData("floatList", addItemToList<Float, float>(data, "floatList", "float"));
}
if (data.hasInputData("boolList") || data.hasInputData("bool")) {
data.setOutputData("boolList", addItemToList<Bool, bool>(data, "boolList", "bool"));
}
if (data.hasInputData("imageList") || data.hasInputData("image")) {
data.setOutputData("imageList", addItemToList<Matrix, Mat>(data, "imageList", "image"));
}
}
示例2: run
/*
data DataManager handles the input and ouput of this module
*/
void SplitChannelsModule::run( DataManager& data) const
{
using namespace cv;
// get a pointers to the input data
Matrix::c_ptr pImage = data.getInputData<Matrix>("image");
// get the actual opencv matrix of the input data
Mat image = pImage->getContent();
// split image into channels
vector<Mat> channels;
split(image, channels);
// convert channels into abstract type
std::list<Matrix::ptr> list;
for(auto it = channels.begin(); it != channels.end(); ++it) {
list.push_back(Matrix::ptr(new Matrix(*it)));
}
// set the result (output) on the datamanager
data.setOutputData("channels", new List<Matrix>(list));
}
示例3: run
void LoadImageModule::run( DataManager& data) const
{
using namespace cv;
Mat image;
std::string strFilename = data.getParam<std::string>("filename","");
// check whether to load the image in grayscale mode, defaults to color
if (data.getParam<std::string>("mode","color").compare("grayscale") == 0)
{
image = imread (strFilename.c_str (), CV_LOAD_IMAGE_GRAYSCALE); // Read the file
}
else
{
image = imread (strFilename.c_str (), CV_LOAD_IMAGE_COLOR); // Read the file
}
if (!image.data)// Check for invalid input
{
throw ErrorException(string("Could not open or find the image: ") + strFilename);
}
data.setOutputData("image",new Matrix(image));
}