12#include <Image/ByteImage.h>
21 template <
class AronImageT>
24 const std::vector<size_t>& imageIndices)
26 for (
size_t i = 0; i < imageIndices.size(); ++i)
31 size_t index = imageIndices[i];
42 const std::vector<size_t>& imageIndices)
44 addImages<arondto::ImageRGB>(entityID, imageIndices);
49 const std::vector<size_t>& imageIndices)
51 addImages<arondto::ImageDepth>(entityID, imageIndices);
58 for (
size_t i = 0; i <
images.size(); ++i)
61 <<
"Currently, all images must be from the same memory.";
69 Eigen::Vector2i dims = dims.Zero();
70 for (
const auto& image :
images)
72 const cv::Mat& img = image->getImage();
73 dims(0) = std::max(dims(0), img.cols);
74 dims(1) = std::max(dims(1), img.rows);
81 const std::vector<armarx::armem::MemoryID>& updatedSnapshotIDs)
84 auto it = std::find_if(updatedSnapshotIDs.begin(),
85 updatedSnapshotIDs.end(),
87 { return id.timestamp > timestamp; });
88 if (it != updatedSnapshotIDs.end())
102 timestamp.toDurationSinceEpoch().toMilliSecondsDouble())},
111 std::stringstream ss;
112 for (
size_t i = 0; i <
images.size(); ++i)
114 ss <<
"- [" <<
images[i]->imageIndex <<
"] id=" <<
images[i]->instanceID <<
"\n";
131 for (
const auto& image :
images)
139 updateAronImages(result.
memory);
147 for (
const auto& image :
images)
149 updated |= image->updateAronImage(memory);
157 std::stringstream ss;
158 for (
const auto& image :
images)
160 ss <<
"- " << image->printFormat() <<
"\n";
The Variant class is described here: Variants.
QueryInput buildQueryInput() const
Client-side working memory.
std::vector< std::unique_ptr< ImageBase > > images
armarx::armem::client::QueryResult fetchLatest()
armarx::armem::client::Reader memoryReader
armarx::armem::Time timestamp
void fetchUpdates(const armarx::armem::MemoryID &entityID, const std::vector< armarx::armem::MemoryID > &updatedSnapshotIDs)
std::string summarizeStructure() const override
armarx::armem::MemoryID getMemoryID() const override
Eigen::Vector2i getImageDimensions() const
void addImagesDepth(const armarx::armem::MemoryID &entityID, const std::vector< size_t > &imageIndices) override
std::string printFormats() const
void addImagesRGB(const armarx::armem::MemoryID &entityID, const std::vector< size_t > &imageIndices) override
std::string debugObserverChannelName
armarx::DebugObserverInterfacePrx debugObserver
ImageAdapter(const std::string &debugObserverChannelName="ImageAdapter")
#define ARMARX_CHECK_EQUAL(lhs, rhs)
This macro evaluates whether lhs is equal (==) rhs and if it turns out to be false it will throw an E...
#define ARMARX_VERBOSE
The logging level for verbose information.
#define TIMING_START(name)
Helper macro to do timing tests.
#define TIMING_END_STREAM(name, os)
Prints duration.
client::QueryResult ClientQueryResult
client::query::Builder ClientQueryBuilder
wm::Memory memory
The slice of the memory that matched the query.