26 #include <VisionX/interface/components/ImageSourceSelectionInterface.h>
27 #include <VisionX/interface/components/Calibration.h>
32 #include <SimoxUtility/algorithm/string/string_tools.h>
40 class StereoResultImageProvider;
42 static std::vector<std::string> stringToVector(std::string propertyValue)
61 defineOptionalProperty<visionx::ImageDimension>(
"TargetDimension", visionx::ImageDimension(640, 480),
"")
62 .setCaseInsensitive(
true)
63 .map(
"320x240", visionx::ImageDimension(320, 240))
64 .map(
"640x480", visionx::ImageDimension(640, 480))
65 .map(
"800x600", visionx::ImageDimension(800, 600))
66 .map(
"768x576", visionx::ImageDimension(768, 576))
67 .map(
"1024x768", visionx::ImageDimension(1024, 768))
68 .map(
"1280x720", visionx::ImageDimension(1280, 960))
69 .map(
"1280x960", visionx::ImageDimension(1280, 960))
70 .map(
"1280x1024", visionx::ImageDimension(1280, 960))
71 .map(
"1600x1200", visionx::ImageDimension(1600, 1200))
72 .map(
"1920x1080", visionx::ImageDimension(1920, 1080))
73 .map(
"1920x1200", visionx::ImageDimension(1920, 1200));
74 defineOptionalProperty<int>(
"NumberOfImages", 0,
"If set to >0, this number of images will be reported. Otherwise, the number of images of the first image provider will be used.");
76 defineOptionalProperty<std::string>(
"resultProviderName",
"Armar3ImageProvider",
"Names of the result image provider");
77 defineOptionalProperty<std::string>(
"defaultProviderName",
"RCImageProvider",
"Name of the image provider to be used when no provider is set.");
97 virtual public ImageSourceSelectionInterface
105 return "ImageSourceSelection";
108 void setImageSource(
const std::string& imageSource,
int relativeTimeoutMs,
const Ice::Current&
c)
override;
112 std::unique_lock lock(imageSourceMutex);
113 return providerTimeouts.empty() ? defaultProvider : providerTimeouts.begin()->first;
156 visionx::ImageDimension targetDimension;
157 float scaleFactorX, scaleFactorY;
159 std::recursive_mutex mutex, imageSourceMutex;
161 std::map<std::string, visionx::CByteImageUPtrVec > cameraImages;
166 std::string defaultProvider;
168 visionx::ImageType imageDisplayType;
171 std::vector<std::pair<std::string, IceUtil::Time>> providerTimeouts;
172 void deleteTimedOutProviders();
179 virtual public visionx::StereoCalibrationProviderInterface
193 return stereoCalibration;
198 return imagesAreUndistorted;
203 return referenceFrame;
206 void setStereoCalibration(visionx::StereoCalibration stereoCalibration,
bool imagesAreUndistorted,
const std::string& referenceFrame)
208 this->stereoCalibration = stereoCalibration;
209 this->imagesAreUndistorted = imagesAreUndistorted;
210 this->referenceFrame = referenceFrame;
211 calibrationPrx->reportStereoCalibrationChanged(this->stereoCalibration, this->imagesAreUndistorted, this->referenceFrame);
225 calibrationPrx = getTopic<StereoCalibrationUpdateInterfacePrx>(
"StereoCalibrationInterface");
229 visionx::StereoCalibration stereoCalibration;
230 bool imagesAreUndistorted;
231 StereoCalibrationUpdateInterfacePrx calibrationPrx;
232 std::string referenceFrame;