40 _widget.horizontalLayoutImageMonitors->addWidget(_maskEditor);
43 QImage bg(512, 512, QImage::Format_ARGB32);
45 _maskEditor->setBackgroundImage(bg);
46 _maskEditor->setPenWidth(_widget.spinBoxPenWidth->value());
47 _maskEditor->setMaskAlpha(_widget.spinBoxPenAlpha->value());
51 connect(_maskEditor, SIGNAL(maskUpdateFinished()),
this, SLOT(maskUpdated()));
53 SIGNAL(arrowDrawn(
const QPoint&,
const QPoint&)),
55 SLOT(arrowDrawn(
const QPoint&,
const QPoint&)));
58 _widget.spinBoxPenWidth, SIGNAL(valueChanged(
int)), _maskEditor, SLOT(setPenWidth(
int)));
60 _widget.spinBoxPenAlpha, SIGNAL(valueChanged(
int)), _maskEditor, SLOT(setMaskAlpha(
int)));
61 connect(_widget.pushButtonClear, SIGNAL(clicked()), _maskEditor, SLOT(clearMaskImage()));
64 _widget.spinBoxImageIndex, SIGNAL(valueChanged(
int)),
this, SLOT(imageIndexChanged(
int)));
65 connect(_widget.checkBoxErase, SIGNAL(clicked()),
this, SLOT(updatePenColor()));
112 if (!_providerImagesOwner.empty())
117 _imageProvider = _imageProviderInfo.proxy;
121 _providerImagesOwner.reserve(_imageProviderInfo.numberImages);
122 _providerImages.reserve(_imageProviderInfo.numberImages);
123 for (
int i = 0; i < _imageProviderInfo.numberImages; ++i)
126 _providerImages.emplace_back(
static_cast<void*
>(_providerImagesOwner.back()->pixels));
128 _numberOfImages = _imageProviderInfo.numberImages;
131 _imageProviderInfo.imageFormat.dimension,
132 visionx::ImageType::eRgb,
133 _imageProviderName +
"_Mask");
136 _imageProviderReferenceFrame =
"Global";
137 auto frameprov = visionx::ReferenceFrameInterfacePrx::checkedCast(_imageProvider);
140 _imageProviderReferenceFrame = frameprov->getReferenceFrame();
144 _imageProviderAreImagesUndistorted =
true;
147 visionx::MonocularCalibrationCapturingProviderInterfacePrx::checkedCast(_imageProvider);
148 auto scalibprov = visionx::StereoCalibrationInterfacePrx::checkedCast(_imageProvider);
151 _imageProviderCalibration = scalibprov->getStereoCalibration();
152 _imageProviderAreImagesUndistorted = scalibprov->getImagesAreUndistorted();
156 ARMARX_WARNING <<
"only monoocular upstream calibration! duplicating it and using "
158 auto mono = mcalibprov->getCalibration();
159 _imageProviderCalibration.calibrationLeft = mono;
160 _imageProviderCalibration.calibrationRight = mono;
161 _imageProviderCalibration.rectificationHomographyLeft = {
162 {1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, 1}};
163 _imageProviderCalibration.rectificationHomographyRight = {
164 {1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, 1}};
166 _imageProviderAreImagesUndistorted =
true;
170 ARMARX_WARNING <<
"no upstream calibration! using default values";
171 _imageProviderCalibration.calibrationLeft.cameraParam.distortion = {0, 0};
172 _imageProviderCalibration.calibrationLeft.cameraParam.focalLength = {50, 50};
173 _imageProviderCalibration.calibrationLeft.cameraParam.height =
174 _imageProviderInfo.imageFormat.dimension.height;
175 _imageProviderCalibration.calibrationLeft.cameraParam.width =
176 _imageProviderInfo.imageFormat.dimension.width;
177 _imageProviderCalibration.calibrationLeft.cameraParam.principalPoint = {
178 _imageProviderInfo.imageFormat.dimension.width / 2.f,
179 _imageProviderInfo.imageFormat.dimension.height / 2.f};
180 _imageProviderCalibration.calibrationLeft.cameraParam.rotation = {
181 {1, 0, 0}, {0, 1, 0}, {0, 0, 1}};
182 _imageProviderCalibration.calibrationLeft.cameraParam.translation = {0, 0, 0};
184 _imageProviderCalibration.calibrationRight = _imageProviderCalibration.calibrationLeft;
185 _imageProviderCalibration.rectificationHomographyLeft = {
186 {1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, 1}};
187 _imageProviderCalibration.rectificationHomographyRight = {
188 {1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, 1}};