34 #include <Image/ImageProcessor.h>
42 auto providersRaw = getProperty<std::string>(
"ImageProviders").getValue();
43 auto providerSplit =
armarx::Split(providersRaw,
";",
true,
true);
45 for (std::string providerStr : providerSplit)
50 std::set<size_t> imageSelection;
51 if (
split.size() >= 2)
53 auto imageSelectionVec = armarx::Split<size_t>(
split.at(1),
",",
true,
true);
54 imageSelection = std::set<size_t>(imageSelectionVec.begin(), imageSelectionVec.end());
62 imageProviderData[name].imageSelection = imageSelection;
68 std::unique_lock lock(mutex);
70 ::visionx::ImageDimension maxDim;
71 for (
auto& pair : imageProviderData)
73 auto name = pair.first;
74 auto&
data = pair.second;
75 auto& selection =
data.imageSelection;
77 const auto& imageProviderInfo =
data.providerInfo;
78 if (selection.empty())
80 for (
int i = 0 ; i < imageProviderInfo.numberImages; i++)
85 data.numImages = imageProviderInfo.numberImages;
86 if (imageProviderInfo.imageFormat != imageProviderInfo.imageFormat)
90 maxDim.width =
std::max(imageProviderInfo.imageFormat.dimension.width, maxDim.width);
91 maxDim.height =
std::max(imageProviderInfo.imageFormat.dimension.height, maxDim.height);
93 data.srcCameraImages.clear();
95 for (
auto&
index : selection)
99 imageProviderInfo.imageFormat.dimension.height,
100 CByteImage::eRGB24)));
104 ARMARX_INFO <<
"max image dimension: " << maxDim.width <<
"x" << maxDim.height;
105 totalNumberOfImages = 0;
106 for (
auto& pair : imageProviderData)
108 auto name = pair.first;
109 auto&
data = pair.second;
110 auto& selection =
data.imageSelection;
111 data.targetCameraImages.clear();
112 data.resize = maxDim.width !=
data.providerInfo.imageFormat.dimension.width
113 || maxDim.height !=
data.providerInfo.imageFormat.dimension.height;
114 ARMARX_INFO << name <<
": image dimension: " <<
data.providerInfo.imageFormat.dimension.width <<
"x" <<
data.providerInfo.imageFormat.dimension.height <<
" resizing: " <<
data.resize;
116 for (
auto&
index : selection)
120 totalNumberOfImages++;
148 std::unique_lock lock(mutex);
149 std::vector<CByteImage*> images;
150 for (
auto& pair : imageProviderData)
152 const auto name = pair.first;
153 auto&
data = pair.second;
163 armarx::MetaInfoSizeBasePtr info;
164 std::vector<CByteImage*> tmpImageVec;
165 for (
auto& image :
data.srcCameraImages)
167 tmpImageVec.push_back(image.get());
169 auto numImg =
getImages(name, tmpImageVec.data(), info);
171 if (numImg !=
data.numImages)
177 for (
auto& image :
data.srcCameraImages)
181 images.push_back(image.get());
185 auto targetImg =
data.targetCameraImages.at(i).get();
186 ::ImageProcessor::Resize(image.get(), targetImg);
187 images.push_back(targetImg);