Ocean
Loading...
Searching...
No Matches
InitializerShrinkingPatchMatchingI1.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8#ifndef META_OCEAN_CV_SYNTHESIS_INITIALIZER_SHRINKING_PATCH_MATCHING_I_1_H
9#define META_OCEAN_CV_SYNTHESIS_INITIALIZER_SHRINKING_PATCH_MATCHING_I_1_H
10
16
19
21
23
24#include "ocean/math/Random.h"
25
26#include <list>
27
28namespace Ocean
29{
30
31namespace CV
32{
33
34namespace Synthesis
35{
36
37/**
38 * This class implements an initializer that shrinks the inpainting mask by the application of images patches.
39 * @ingroup cvsynthesis
40 */
41class OCEAN_CV_SYNTHESIS_EXPORT InitializerShrinkingPatchMatchingI1 :
42 virtual public InitializerI,
43 virtual public InitializerRandomized,
44 virtual public Initializer1
45{
46 private:
47
48 /**
49 * Definition of a wrapper class for ssd functions.
50 */
52 {
53 public:
54
55 /**
56 * Wrapper function for AdvancedSumSquareDifferences::patchWithRejectingMask8BitPerChannel().
57 * @see AdvancedSumSquareDifferences::patchWithRejectingMask8BitPerChannel().
58 */
59 template <unsigned int tChannels>
60 static inline unsigned int determine5x5(const uint8_t* frame, const uint8_t* mask, const unsigned int width, const unsigned int height, const unsigned int framePaddingElements, const unsigned int maskPaddingElements, const CV::PixelPosition& inPosition, const CV::PixelPosition& outPosition);
61 };
62
63 /**
64 * Definition of a wrapper class for ssd functions.
65 */
67 {
68 public:
69
70 /**
71 * Wrapper function for SumSquareDifferences::patchAtBorder8BitPerChannel.
72 * @see SumSquareDifferences::patchAtBorder8BitPerChannel().
73 */
74 template <unsigned int tChannels>
75 static inline unsigned int determine5x5(const uint8_t* frame, const uint8_t* mask, const unsigned int width, const unsigned int height, const unsigned int framePaddingElements, const unsigned int maskPaddingElements, const CV::PixelPosition& inPosition, const CV::PixelPosition& outPosition);
76 };
77
78 /**
79 * This class implements a single inpainting pixel.
80 */
82 {
83 public:
84
85 /**
86 * Creates a new inpainting pixel by a given border direction and image orientation.
87 * @param position Inpainting pixel position
88 * @param borderDirection Direction of the inpainting border
89 * @param imageOrientation Orientation of the surrounding image
90 */
91 inline InpaintingPixel(const PixelPosition& position, const VectorI2& borderDirection, const VectorI2& imageOrientation);
92
93 /**
94 * Returns the border direction of this inpainting pixel.
95 * @return Border direction
96 */
97 inline const VectorI2& borderDirection() const;
98
99 /**
100 * Returns the image orientation of this inpainting pixel.
101 * @return Image orientation
102 */
103 inline const VectorI2& imageOrientation() const;
104
105 /**
106 * Returns the priority of this inpainting pixel.
107 * @return Pixel priority
108 */
109 inline unsigned int priority() const;
110
111 /**
112 * Sets the border direction of this inpainting pixel.
113 * @param direction Border direction to be set
114 */
115 inline void setBorderDirection(const VectorI2& direction);
116
117 /**
118 * Sets the image orientation of this inpainting pixel.
119 * @param orientation Image orientation to be set
120 */
121 inline void setImageOrientation(const VectorI2& orientation);
122
123 /**
124 * Determines the border direction of a border pixel by a 5x5 area.
125 * @param mask The mask frame, must be valid
126 * @param width The width of the mask in pixel, with range [1, infinity)
127 * @param height The height of the mask in pixel, with range [1, infinity)
128 * @param maskPaddingElements The number of padding elements at the end of each mask row, in elements, with range [0, infinity)
129 * @param position The position to determine the direction for, this pixel must be a mask-border pixel, with range [0, with-1]x[0, height-1]
130 * @return Resulting direction
131 */
132 static VectorI2 determineBorderDirection5x5(const uint8_t* mask, const unsigned int width, const unsigned int height, const unsigned int maskPaddingElements, const PixelPosition& position);
133
134 /**
135 * Determines the image orientation at a given position.
136 * The template parameter given the depth of the given response
137 * @param sobelResponse The Sobel filter response used to determine the image orientation, must be valid
138 * @param mask The mask frame with same frame dimension as the response frame, must be valid
139 * @param width The width of the frame in pixel, with range [1, infinity)
140 * @param height The height of the frame in pixel, with range [1, infinity)
141 * @param sobelStrideElements The number of elements between two consecutive Sobel response rows, in elements, with range [width*2, infinity)
142 * @param maskPaddingElements The number of padding elements at the end of each mask row, in elements, with range [0, infinity)
143 * @param position The position to determine the image orientation for, this pixel must be a mask-border pixel, with range [0, with-1]x[0, height-1]
144 * @tparam tChannels Number of channels of the frame for which the sobel response is provided, with range [1, infinity)
145 */
146 template <unsigned int tChannels>
147 static VectorI2 determineImageOrientation5x5(const int16_t* sobelResponse, const uint8_t* mask, const unsigned int width, const unsigned int height, const unsigned int sobelStrideElements, const unsigned int maskPaddingElements, const CV::PixelPosition& position);
148
149 /**
150 * Returns whether this inpainting pixel has a lower priority than a second one.
151 * @param right Second inpainting pixel to be compared
152 * @return True, if so
153 */
154 inline bool operator<(const InpaintingPixel& right) const;
155
156 /**
157 * Returns whether two inpainting pixels are identical.
158 * @param right Second inpainting pixel
159 * @return True, if so
160 */
161 inline bool operator==(const InpaintingPixel& right) const;
162
163 protected:
164
165 /// Image orientation.
167
168 /// Border direction.
170
171 /// Inpainting priority.
172 unsigned int priority_ = 0u;
173 };
174
175 /**
176 * Definition of a list holding inpainting pixels.
177 */
178 using InpaintingPixelList = std::list<InpaintingPixel>;
179
180 public:
181
182 /**
183 * Creates a new initializer object.
184 * @param layer The layer for that the initial mapping has to be provided
185 * @param randomGenerator Random number generator
186 * @param iterations Number of shrinking iterations
187 * @param heuristic True, to apply a heuristic optimization, faster but more inaccurate
188 * @param maximalBoundingBoxOffset Maximal search offset around an inpainting pixel to be used in the non-heuristic mode
189 */
190 inline InitializerShrinkingPatchMatchingI1(LayerI1& layer, RandomGenerator& randomGenerator, const unsigned int iterations = 2u, const bool heuristic = false, const unsigned int maximalBoundingBoxOffset = 0xFFFFFFFF);
191
192 /**
193 * Invokes the initialization process.
194 * @see Initializer::invoke().
195 */
196 bool invoke(Worker* worker = nullptr) const override;
197
198 private:
199
200 /**
201 * Invokes the initialization process.
202 * @tparam tChannels The number of frame channels, with range [1, infinity)
203 */
204 template <unsigned int tChannels>
205 bool invoke(Worker* worker) const;
206
207 /**
208 * Applies the first iterations of the patch initialization for a frame using 5x5 areas.
209 * @param sobelResponse Horizontal and vertical sobel response for the given frame, must be valid
210 * @param staticMask Static inpainting mask to be filled with 0xFF for non-mask pixels, must be valid
211 * @param randomGenerator The random generator to be used
212 * @return True, if succeeded
213 * @tparam tChannels Number of channels of the frame
214 * @tparam SSD SSD wrapper class that is used to determine the patch similarity
215 */
216 template<unsigned int tChannels, typename SSD>
217 bool patchInitializationIteration5x5(Frame& sobelResponse, const Frame& staticMask, RandomGenerator& randomGenerator) const;
218
219 private:
220
221 /// Number of initialization iterations.
222 const unsigned int iterations_;
223
224 /// Heuristic execution statement of the initializer.
225 const bool heuristic_;
226
227 /// Maximal search offset that is applied during the initialization for each inpainting pixel.
228 const unsigned int maximalBoundingBoxOffset_;
229};
230
239
244
249
251{
252 return priority_;
253}
254
260
262{
263 imageOrientation_ = orientation;
264 priority_ = abs(imageOrientation_.perpendicular() * borderDirection_);
265}
266
267template <unsigned int tChannels>
268VectorI2 InitializerShrinkingPatchMatchingI1::InpaintingPixel::determineImageOrientation5x5(const int16_t* sobelResponse, const uint8_t* mask, const unsigned int width, const unsigned int height, const unsigned int sobelStrideElements, const unsigned int maskPaddingElements, const CV::PixelPosition& position)
269{
270 static_assert(tChannels >= 1u, "Invalid channel number!");
271
272 ocean_assert(sobelResponse != nullptr && mask != nullptr);
273
274 ocean_assert(sobelStrideElements >= width * 2u);
275 ocean_assert(position.x() < width && position.y() < height);
276
277 VectorI2 orientation(0, 0);
278
279 // as the response values will be zero at the image borders border pixels does not need to be investigated
280
281 for (unsigned int y = max(1, int(position.y()) - 2); y < min(position.y() + 3u, height - 1u); ++y)
282 {
283 for (unsigned int x = max(1, int(position.x()) - 2); x < min(position.x() + 3u, width - 1u); ++x)
284 {
285 constexpr uint8_t nonMaskPixelValue = 0xFFu;
286
287 if (!Segmentation::MaskAnalyzer::hasMaskNeighbor9<false>(mask, width, height, maskPaddingElements, PixelPosition(x, y), nonMaskPixelValue))
288 {
289 const int16_t* const sobelPixel = sobelResponse + y * sobelStrideElements + x * tChannels * 2u;
290
291 for (unsigned int n = 0u; n < tChannels; ++n)
292 {
293 const int16_t responseX = sobelPixel[n * 2u + 0u];
294 const int16_t responseY = sobelPixel[n * 2u + 1u];
295
296 if (responseX >= 0)
297 {
298 orientation += VectorI2(responseX, responseY);
299 }
300 else
301 {
302 orientation -= VectorI2(responseX, responseY);
303 }
304 }
305 }
306 }
307 }
308
309 return orientation;
310}
311
313{
314 //return pixelPriority < right.pixelPriority;
315 if(priority_ < right.priority_)
316 {
317 return true;
318 }
319
320 if (priority_ == right.priority_)
321 {
322 return index(1000) < right.index(1000);
323 }
324
325 return false;
326}
327
332
333inline InitializerShrinkingPatchMatchingI1::InitializerShrinkingPatchMatchingI1(LayerI1& layer, RandomGenerator& randomGenerator, const unsigned int initializations, const bool heuristic, const unsigned int maximalBoundingBoxOffset) :
334 Initializer(layer),
335 InitializerI(layer),
336 InitializerRandomized(layer, randomGenerator),
337 Initializer1(layer),
338 iterations_(initializations),
339 heuristic_(heuristic),
340 maximalBoundingBoxOffset_(maximalBoundingBoxOffset)
341{
342 // nothing to do here
343}
344
345template <unsigned int tChannels>
346inline unsigned int InitializerShrinkingPatchMatchingI1::SSDWrapperMask::determine5x5(const uint8_t* frame, const uint8_t* mask, const unsigned int width, const unsigned int height, const unsigned int framePaddingElements, const unsigned int maskPaddingElements, const CV::PixelPosition& inPosition, const CV::PixelPosition& outPosition)
347{
348 constexpr uint8_t maskValue = 0x00u;
349
350 return Advanced::AdvancedSumSquareDifferences::patchWithRejectingMask8BitPerChannel<tChannels>(frame, frame, mask, mask, 5u, width, height, width, height, inPosition.x(), inPosition.y(), outPosition.x(), outPosition.y(), framePaddingElements, framePaddingElements, maskPaddingElements, maskPaddingElements, maskValue).first;
351}
352
353template <unsigned int tChannels>
354inline unsigned int InitializerShrinkingPatchMatchingI1::SSDWrapper::determine5x5(const uint8_t* frame, const uint8_t* /*mask*/, const unsigned int width, const unsigned int height, const unsigned int framePaddingElements, const unsigned int /*maskPaddingElements*/, const CV::PixelPosition& inPosition, const CV::PixelPosition& outPosition)
355{
356 return SumSquareDifferences::patchAtBorder8BitPerChannel<tChannels, 5u>(frame, frame, width, height, width, height, inPosition.x(), inPosition.y(), outPosition.x(), outPosition.y(), framePaddingElements, framePaddingElements).first;
357}
358
359template<unsigned int tChannels, typename SSD>
360bool InitializerShrinkingPatchMatchingI1::patchInitializationIteration5x5(Frame& sobelResponse, const Frame& staticMask, RandomGenerator& randomGenerator) const
361{
362 static_assert(tChannels >= 1u, "Invalid number of frame channels!");
363
364 Frame& frame = layer_.frame();
365
366 MappingI& mapping = layerI_.mapping();
367
368 const unsigned int width = layer_.width();
369 const unsigned int height = layer_.height();
370
371 ocean_assert(frame.isValid());
372 ocean_assert(sobelResponse.isValid() && staticMask.isValid());
373
374 const CV::PixelBoundingBox& boundingBox = layerI_.boundingBox();
375
376#ifdef OCEAN_DEBUG
377 for (unsigned int y = 0; y < height; ++y)
378 {
379 for (unsigned int x = 0; x < width; ++x)
380 {
381 const CV::PixelPosition& position = mapping.position(x, y);
382
383 ocean_assert(!position.isValid() || (position.x() < width && position.y() < height));
384 }
385 }
386#endif
387
388 Frame dynamicMask(staticMask, Frame::ACM_COPY_REMOVE_PADDING_LAYOUT);
389
390 uint8_t* const frameData = frame.data<uint8_t>();
391 const unsigned int framePaddingElements = frame.paddingElements();
392 const unsigned int frameStrideElements = frame.strideElements();
393
394 const uint8_t* const staticMaskData = staticMask.constdata<uint8_t>();
395 const unsigned int staticMaskStrideElements = staticMask.strideElements();
396
397 uint8_t* const dynamicMaskData = dynamicMask.data<uint8_t>();
398 const unsigned int dynamicMaskPaddingElements = dynamicMask.paddingElements();
399 const unsigned int dynamicMaskStrideElements = dynamicMask.strideElements();
400
401 int16_t* const sobelResponseData = sobelResponse.data<int16_t>();
402 const unsigned int sobelResponseStrideElements = sobelResponse.strideElements();
403
404 CV::PixelPositions borderPixels;
405 borderPixels.reserve(1024);
406
407 Segmentation::MaskAnalyzer::findBorderPixels4(dynamicMask.constdata<uint8_t>(), width, height, dynamicMask.paddingElements(), borderPixels, boundingBox);
408
409 InpaintingPixelList inpaintingPixels;
410 for (const CV::PixelPosition& borderPixel : borderPixels)
411 {
412 const VectorI2 borderDirection(InpaintingPixel::determineBorderDirection5x5(dynamicMaskData, width, height, dynamicMaskPaddingElements, borderPixel));
413 const VectorI2 imageOrientation(InpaintingPixel::determineImageOrientation5x5<tChannels>(sobelResponseData, dynamicMaskData, width, height, sobelResponseStrideElements, dynamicMaskPaddingElements, borderPixel));
414
415 inpaintingPixels.emplace_back(borderPixel, borderDirection, imageOrientation);
416 }
417
418 inpaintingPixels.sort();
419
420 while (!inpaintingPixels.empty())
421 {
422 const InpaintingPixel position = inpaintingPixels.back();
423 ocean_assert(dynamicMask.constpixel<uint8_t>(position.x(), position.y())[0] != 0xFF);
424
425 inpaintingPixels.pop_back();
426
427 unsigned int ssdBest = (unsigned int)(-1);
428
429 unsigned int xBest = (unsigned int)(-1);
430 unsigned int yBest = (unsigned int)(-1);
431
432 if (heuristic_)
433 {
434 const CV::PixelPosition& center = mapping.position(position);
435
436 // propagation itself
437 if (center.isValid())
438 {
439 for (unsigned int y = max(0, int(center.y()) - 3); y < min(center.y() + 4u, height); ++y)
440 {
441 for (unsigned int x = max(0, int(center.x()) - 3); x < min(center.x() + 4u, width); ++x)
442 {
443 if ((y != position.y() || x != position.x()) && staticMaskData[y * staticMaskStrideElements + x] == 0xFF)
444 {
445 const unsigned int ssd = SSD::template determine5x5<tChannels>(frameData, dynamicMaskData, width, height, framePaddingElements, dynamicMaskPaddingElements, position, PixelPosition(x, y));
446
447 if (ssd < ssdBest)
448 {
449 ssdBest = ssd;
450 xBest = x;
451 yBest = y;
452 }
453 }
454 }
455 }
456 }
457
458 // propagation left
459 if (position.x() != 0u && mapping.position(position.west()).isValid())
460 {
461 const PixelPosition east(mapping.position(position.west()).east());
462
463 for (unsigned int y = max(0, int(east.y()) - 3); y < min(east.y() + 4u, height); ++y)
464 {
465 for (unsigned int x = max(0, int(east.x()) - 3); x < min(east.x() + 4u, width); ++x)
466 {
467 if ((y != position.y() || x != position.x()) && staticMaskData[y * staticMaskStrideElements + x] == 0xFF)
468 {
469 const unsigned int ssd = SSD::template determine5x5<tChannels>(frameData, dynamicMaskData, width, height, framePaddingElements, dynamicMaskPaddingElements, position, PixelPosition(x, y));
470
471 if (ssd < ssdBest)
472 {
473 ssdBest = ssd;
474 xBest = x;
475 yBest = y;
476 }
477 }
478 }
479 }
480 }
481
482 // propagation top left
483 if (position.x() != 0u && position.y() != 0u && mapping.position(position.northWest()).isValid())
484 {
485 const PixelPosition southEast(mapping.position(position.northWest()).southEast());
486
487 for (unsigned int y = max(0, int(southEast.y()) - 3); y < min(southEast.y() + 4u, height); ++y)
488 {
489 for (unsigned int x = max(0, int(southEast.x()) - 3); x < min(southEast.x() + 4u, width); ++x)
490 {
491 if ((y != position.y() || x != position.x()) && staticMaskData[y * staticMaskStrideElements + x] == 0xFF)
492 {
493 const unsigned int ssd = SSD::template determine5x5<tChannels>(frameData, dynamicMaskData, width, height, framePaddingElements, dynamicMaskPaddingElements, position, PixelPosition(x, y));
494
495 if (ssd < ssdBest)
496 {
497 ssdBest = ssd;
498 xBest = x;
499 yBest = y;
500 }
501 }
502 }
503 }
504 }
505
506 // propagation top
507 if (position.y() != 0u && mapping.position(position.north()).isValid())
508 {
509 const PixelPosition south(mapping.position(position.north()).south());
510
511 for (unsigned int y = max(0, int(south.y()) - 3); y < min(south.y() + 4u, height); ++y)
512 {
513 for (unsigned int x = max(0, int(south.x()) - 3); x < min(south.x() + 4u, width); ++x)
514 {
515 if ((y != position.y() || x != position.x()) && staticMaskData[y * staticMaskStrideElements + x] == 0xFF)
516 {
517 const unsigned int ssd = SSD::template determine5x5<tChannels>(frameData, dynamicMaskData, width, height, framePaddingElements, dynamicMaskPaddingElements, position, PixelPosition(x, y));
518
519 if (ssd < ssdBest)
520 {
521 ssdBest = ssd;
522 xBest = x;
523 yBest = y;
524 }
525 }
526 }
527 }
528 }
529
530 // propagation top right
531 if (position.y() != 0u && position.x() + 1u < width && mapping.position(position.northEast()).isValid())
532 {
533 const PixelPosition southWest(mapping.position(position.northEast()).southWest());
534
535 for (unsigned int y = max(0, int(southWest.y()) - 3); y < min(southWest.y() + 4u, height); ++y)
536 {
537 for (unsigned int x = max(0, int(southWest.x()) - 3); x < min(southWest.x() + 4u, width); ++x)
538 {
539 if ((y != position.y() || x != position.x()) && staticMaskData[y * staticMaskStrideElements + x] == 0xFF)
540 {
541 const unsigned int ssd = SSD::template determine5x5<tChannels>(frameData, dynamicMaskData, width, height, framePaddingElements, dynamicMaskPaddingElements, position, PixelPosition(x, y));
542
543 if (ssd < ssdBest)
544 {
545 ssdBest = ssd;
546 xBest = x;
547 yBest = y;
548 }
549 }
550 }
551 }
552 }
553
554 // propagation right
555 if (position.x() + 1u < width && mapping.position(position.east()).isValid())
556 {
557 const PixelPosition west(mapping.position(position.east()).west());
558
559 for (unsigned int y = max(0, int(west.y()) - 3); y < min(west.y() + 4u, height); ++y)
560 {
561 for (unsigned int x = max(0, int(west.x()) - 3); x < min(west.x() + 4u, width); ++x)
562 {
563 if ((y != position.y() || x != position.x()) && staticMaskData[y * staticMaskStrideElements + x] == 0xFF)
564 {
565 const unsigned int ssd = SSD::template determine5x5<tChannels>(frameData, dynamicMaskData, width, height, framePaddingElements, dynamicMaskPaddingElements, position, PixelPosition(x, y));
566
567 if (ssd < ssdBest)
568 {
569 ssdBest = ssd;
570 xBest = x;
571 yBest = y;
572 }
573 }
574 }
575 }
576 }
577
578 // propagation bottom right
579 if (position.y() + 1u < height && position.x() + 1u < width && mapping.position(position.southEast()).isValid())
580 {
581 const PixelPosition northWest(mapping.position(position.southEast()).northWest());
582
583 for (unsigned int y = max(0, int(northWest.y()) - 3); y < min(northWest.y() + 4u, height); ++y)
584 {
585 for (unsigned int x = max(0, int(northWest.x()) - 3); x < min(northWest.x() + 4u, width); ++x)
586 {
587 if ((y != position.y() || x != position.x()) && staticMaskData[y * staticMaskStrideElements + x] == 0xFF)
588 {
589 const unsigned int ssd = SSD::template determine5x5<tChannels>(frameData, dynamicMaskData, width, height, framePaddingElements, dynamicMaskPaddingElements, position, PixelPosition(x, y));
590
591 if (ssd < ssdBest)
592 {
593 ssdBest = ssd;
594 xBest = x;
595 yBest = y;
596 }
597 }
598 }
599 }
600 }
601
602 // propagation bottom
603 if (position.y() + 1u < height && mapping.position(position.south()).isValid())
604 {
605 const PixelPosition north(mapping.position(position.south()).north());
606
607 for (unsigned int y = max(0, int(north.y()) - 3); y < min(north.y() + 4u, height); ++y)
608 {
609 for (unsigned int x = max(0, int(north.x()) - 3); x < min(north.x() + 4u, width); ++x)
610 {
611 if ((y != position.y() || x != position.x()) && staticMaskData[y * staticMaskStrideElements + x] == 0xFF)
612 {
613 const unsigned int ssd = SSD::template determine5x5<tChannels>(frameData, dynamicMaskData, width, height, framePaddingElements, dynamicMaskPaddingElements, position, PixelPosition(x, y));
614
615 if (ssd < ssdBest)
616 {
617 ssdBest = ssd;
618 xBest = x;
619 yBest = y;
620 }
621 }
622 }
623 }
624 }
625
626 // propagation bottom left
627 if (position.x() != 0u && position.y() + 1u < height && mapping.position(position.southWest()).isValid())
628 {
629 const PixelPosition northEast(mapping.position(position.southWest()).northEast());
630
631 for (unsigned int y = max(0, int(northEast.y()) - 3); y < min(northEast.y() + 4u, height); ++y)
632 {
633 for (unsigned int x = max(0, int(northEast.x()) - 3); x < min(northEast.x() + 4u, width); ++x)
634 {
635 if ((y != position.y() || x != position.x()) && staticMaskData[y * staticMaskStrideElements + x] == 0xFF)
636 {
637 const unsigned int ssd = SSD::template determine5x5<tChannels>(frameData, dynamicMaskData, width, height, framePaddingElements, dynamicMaskPaddingElements, position, PixelPosition(x, y));
638
639 if (ssd < ssdBest)
640 {
641 ssdBest = ssd;
642 xBest = x;
643 yBest = y;
644 }
645 }
646 }
647 }
648 }
649
650 Scalar diagonal_4 = min(Vector2(Scalar(width), Scalar(height)).length() * Scalar(0.25), Scalar(10));
651 Vector3 normal(Scalar(position.borderDirection().x()), Scalar(position.borderDirection().y()), 0);
652
653 if (normal.normalize())
654 {
655 for (unsigned int n = 0u; n < 100u; ++n)
656 {
657 Rotation rotation(0, 0, 1, Random::scalar(randomGenerator, -Numeric::deg2rad(90), Numeric::deg2rad(90)));
658 const Scalar length = Random::scalar(randomGenerator, 1, diagonal_4);
659 const Vector3 offset = rotation * normal * length;
660
661 const PixelPosition first(position.x() + Numeric::round32(offset.x()), position.y() + Numeric::round32(offset.y()));
662 if (first.x() < width && first.y() < height && staticMaskData[first.y() * staticMaskStrideElements + first.x()] == 0xFF)
663 {
664 const unsigned int ssd = SSD::template determine5x5<tChannels>(frameData, dynamicMaskData, width, height, framePaddingElements, dynamicMaskPaddingElements, position, first);
665
666 if (ssd < ssdBest)
667 {
668 ssdBest = ssd;
669
670 xBest = first.x();
671 yBest = first.y();
672 }
673 }
674
675 const PixelPosition second(position.x() - Numeric::round32(offset.x()), position.y() - Numeric::round32(offset.y()));
676 if (second.x() < width && second.y() < height && staticMaskData[second.y() * staticMaskStrideElements + second.x()] == 0xFF)
677 {
678 const unsigned int ssd = SSD::template determine5x5<tChannels>(frameData, dynamicMaskData, width, height, framePaddingElements, dynamicMaskPaddingElements, position, second);
679
680 if (ssd < ssdBest)
681 {
682 ssdBest = ssd;
683
684 xBest = second.x();
685 yBest = second.y();
686 }
687 }
688 }
689 }
690
691 if (ssdBest != (unsigned int)(-1))
692 {
693 const unsigned int iterations = 200u;
694 for (unsigned int n = 0u; n < iterations; ++n)
695 {
696 const int xRadius = max(1, int(width - (width - 1u) * n / iterations) >> 1);
697 const int yRadius = max(1, int(height - (height - 1u) * n / iterations) >> 1);
698
699 const int offsetX = RandomI::random(randomGenerator, -xRadius, xRadius);
700 const int offsetY = RandomI::random(randomGenerator, -yRadius, yRadius);
701
702 const unsigned int randomX = xBest + offsetX;
703 const unsigned int randomY = yBest + offsetY;
704
705 if (randomX < width && randomY < height && (randomY != position.y() || randomX != position.x()) && staticMaskData[randomY * staticMaskStrideElements + randomX] == 0xFF)
706 {
707 const unsigned int ssd = SSD::template determine5x5<tChannels>(frameData, dynamicMaskData, width, height, framePaddingElements, dynamicMaskPaddingElements, position, CV::PixelPosition(randomX, randomY));
708
709 if (ssd < ssdBest)
710 {
711 ssdBest = ssd;
712
713 xBest = randomX;
714 yBest = randomY;
715 }
716 }
717 }
718 }
719 }
720
721 if (ssdBest == (unsigned int)(-1))
722 {
723 if (maximalBoundingBoxOffset_ == (unsigned int)(-1))
724 {
725 // find the best matching patch with brute force
726 for (unsigned int y = 0u; y < height; ++y)
727 {
728 const uint8_t* const staticMaskRow = staticMask.constrow<uint8_t>(y);
729
730 for (unsigned int x = 0u; x < width; ++x)
731 {
732 if ((y != position.y() || x != position.x()) && staticMaskRow[x] == 0xFF)
733 {
734 const unsigned int ssd = SSD::template determine5x5<tChannels>(frameData, dynamicMaskData, width, height, framePaddingElements, dynamicMaskPaddingElements, position, CV::PixelPosition(x, y));
735
736 if (ssd < ssdBest)
737 {
738 ssdBest = ssd;
739
740 xBest = x;
741 yBest = y;
742 }
743 }
744 }
745 }
746 }
747 else
748 {
749 const unsigned int left = max(0, int(position.x() - maximalBoundingBoxOffset_));
750 const unsigned int top = max(0, int(position.y() - maximalBoundingBoxOffset_));
751
752 const unsigned int rightEnd = min(position.x() + maximalBoundingBoxOffset_ + 1u, width);
753 const unsigned int bottomEnd = min(position.y() + maximalBoundingBoxOffset_ + 1u, height);
754
755 // find the best matching patch with brute force
756 for (unsigned int y = top; y < bottomEnd; ++y)
757 {
758 for (unsigned int x = left; x < rightEnd; ++x)
759 {
760 if ((y != position.y() || x != position.x()) && staticMaskData[y * staticMaskStrideElements + x] == 0xFF)
761 {
762 const unsigned int ssd = SSD::template determine5x5<tChannels>(frameData, dynamicMaskData, width, height, framePaddingElements, dynamicMaskPaddingElements, position, CV::PixelPosition(x, y));
763
764 if (ssd < ssdBest)
765 {
766 ssdBest = ssd;
767
768 xBest = x;
769 yBest = y;
770 }
771 }
772 }
773 }
774 }
775 }
776
777 if (ssdBest == (unsigned int)(-1))
778 {
779 // The dynamic mask also contains pixels synthesized earlier in this
780 // iteration. They are not valid mapping sources: applying the mapping
781 // to another frame must only read pixels outside the original mask.
782 for (unsigned int y = 0u; ssdBest == (unsigned int)(-1) && y < height; ++y)
783 {
784 const uint8_t* staticMaskRow = staticMask.constrow<uint8_t>(y);
785
786 for (unsigned int x = 0u; x < width; ++x)
787 {
788 if (staticMaskRow[x] == 0xFFu)
789 {
790 ssdBest = (unsigned int)(-2);
791
792 xBest = x;
793 yBest = y;
794
795 break;
796 }
797 }
798 }
799 }
800
801 if (ssdBest == (unsigned int)(-1))
802 {
803 return false;
804 }
805
806 ocean_assert(xBest < width && yBest < height);
807
808 // update the color frame border pixel itself
809 CVUtilities::copyPixel<tChannels>(frameData + position.y() * frameStrideElements + position.x() * tChannels, frameData + yBest * frameStrideElements + xBest * tChannels);
810
811 for (unsigned int y = max(0, int(position.y()) - 1); y < min(position.y() + 2u, height); ++y)
812 {
813 for (unsigned int x = max(0, int(position.x()) - 1); x < min(position.x() + 2u, width); ++x)
814 {
815 CV::FrameFilterSobel::filterPixelHorizontalVertical8BitPerChannel<int16_t, tChannels>(frameData, width, height, x, y, sobelResponseData + y * sobelResponseStrideElements + x * tChannels * 2u, framePaddingElements);
816 }
817 }
818
819 // find new border pixel
820 PixelPositions newBorderPixels;
821 newBorderPixels.reserve(4u);
822
823 constexpr uint8_t nonMaskPixelValue = 0xFF;
824
825 // check all pixels in the 4-neighborhood without frame border pixels as frame border pixels are mask-border pixels by definition already
826 if (position.x() - 1u < width - 2u)
827 {
828 // north
829 if (position.y() > 1u && !Segmentation::MaskAnalyzer::hasMaskNeighbor5<true>(dynamicMaskData, width, height, dynamicMaskPaddingElements, position.north(), nonMaskPixelValue))
830 {
831 newBorderPixels.emplace_back(position.north());
832 }
833
834 // south
835 if (position.y() + 2u < height && !Segmentation::MaskAnalyzer::hasMaskNeighbor5<true>(dynamicMaskData, width, height, dynamicMaskPaddingElements, position.south(), nonMaskPixelValue))
836 {
837 newBorderPixels.emplace_back(position.south());
838 }
839 }
840
841 if (position.y() - 1u < height - 2u)
842 {
843 // west
844 if (position.x() > 1u && !Segmentation::MaskAnalyzer::hasMaskNeighbor5<true>(dynamicMaskData, width, height, dynamicMaskPaddingElements, position.west(), nonMaskPixelValue))
845 {
846 newBorderPixels.emplace_back(position.west());
847 }
848
849 // east
850 if (position.x() + 2u < width && !Segmentation::MaskAnalyzer::hasMaskNeighbor5<true>(dynamicMaskData, width, height, dynamicMaskPaddingElements, position.east(), nonMaskPixelValue))
851 {
852 newBorderPixels.emplace_back(position.east());
853 }
854 }
855
856#ifdef OCEAN_DEBUG
857
858 for (const PixelPosition& newBorerPixel : newBorderPixels)
859 {
860 for (const InpaintingPixel& inpaintingPixel : inpaintingPixels)
861 {
862 ocean_assert(newBorerPixel != inpaintingPixel);
863 }
864 }
865
866#endif // OCEAN_DEBUG
867
868 // update the border mask frame
869 ocean_assert(dynamicMask.constpixel<uint8_t>(position.x(), position.y())[0] != 0xFFu);
870 ocean_assert(staticMask.constpixel<uint8_t>(xBest, yBest)[0] == 0xFFu);
871
872 dynamicMaskData[position.y() * dynamicMaskStrideElements + position.x()] = 0xFFu;
873
874 mapping.setPosition(position.x(), position.y(), PixelPosition(xBest, yBest));
875
876 InpaintingPixelList changedInpaintingPixels;
877
878 // update all inpainting positions inside the direction neighborhood, stop if all pixels have been updated
879 for (InpaintingPixelList::iterator i = inpaintingPixels.begin(); i != inpaintingPixels.end(); /* noop */)
880 {
881 ocean_assert(*i != position);
882
883 // check whether the point is inside the small neighborhood
884 const int dx = abs(int(i->x()) - int(position.x()));
885 const int dy = abs(int(i->y()) - int(position.y()));
886
887 if (dx <= 3 && dy <= 3)
888 {
889 // the border direction might have changed
890 changedInpaintingPixels.emplace_back(*i, InpaintingPixel::determineBorderDirection5x5(dynamicMaskData, width, height, dynamicMaskPaddingElements, *i), InpaintingPixel::determineImageOrientation5x5<tChannels>(sobelResponseData, dynamicMaskData, width, height, sobelResponseStrideElements, dynamicMaskPaddingElements, *i));
891
892 i = inpaintingPixels.erase(i);
893 }
894 else
895 {
896 ++i;
897 }
898 }
899
900 // add new border pixels
901 for (const PixelPosition& newBorderPixel : newBorderPixels)
902 {
903 changedInpaintingPixels.emplace_back(newBorderPixel, InpaintingPixel::determineBorderDirection5x5(dynamicMaskData, width, height, dynamicMaskPaddingElements, newBorderPixel), InpaintingPixel::determineImageOrientation5x5<tChannels>(sobelResponseData, dynamicMaskData, width, height, sobelResponseStrideElements, dynamicMaskPaddingElements, newBorderPixel));
904 }
905
906 changedInpaintingPixels.sort();
907 inpaintingPixels.merge(changedInpaintingPixels);
908
909#ifdef OCEAN_DEBUG
910 for (const InpaintingPixel& inpaintingPixel : inpaintingPixels)
911 {
912 ocean_assert(inpaintingPixel == InpaintingPixel(inpaintingPixel, InpaintingPixel::determineBorderDirection5x5(dynamicMaskData, width, height, dynamicMaskPaddingElements, inpaintingPixel), InpaintingPixel::determineImageOrientation5x5<tChannels>(sobelResponseData, dynamicMaskData, width, height, sobelResponseStrideElements, dynamicMaskPaddingElements, inpaintingPixel)));
913 }
914#endif // OCEAN_DEBUG
915 }
916
917#ifdef OCEAN_DEBUG
918 for (unsigned int y = 0; y < height; ++y)
919 {
920 for (unsigned int x = 0; x < width; ++x)
921 {
922 ocean_assert(dynamicMask.constpixel<uint8_t>(x, y)[0] == 0xFFu);
923 const CV::PixelPosition& position = mapping.position(x, y);
924
925 if (staticMask.constpixel<uint8_t>(x, y)[0] != 0xFFu)
926 {
927 ocean_assert(position.isValid() && position.x() < width && position.y() < height);
928 }
929 else
930 {
931 ocean_assert(!position.isValid());
932 }
933 }
934 }
935#endif
936
937 return true;
938}
939
940}
941
942}
943
944}
945
946#endif // META_OCEAN_CV_SYNTHESIS_INITIALIZER_SHRINKING_PATCH_MATCHING_I_1_H
static IndexPair32 patchWithRejectingMask8BitPerChannel(const uint8_t *image0, const uint8_t *image1, const uint8_t *mask0, const uint8_t *mask1, const unsigned int patchSize, const unsigned int width0, const unsigned int height0, const unsigned int width1, const unsigned int height1, const unsigned int centerX0, const unsigned int centerY0, const unsigned int centerX1, const unsigned int centerY1, const unsigned int image0PaddingElements, const unsigned int image1PaddingElements, const unsigned int mask0PaddingElements, const unsigned int mask1PaddingElements, const uint8_t maskValue)
Returns the sum of square differences for an image patch determined for two pixel accurate positions ...
Definition AdvancedSumSquareDifferences.h:313
static void copyPixel(T *const target, const T *const source)
Copies the pixel value from one pixel to another.
Definition CVUtilities.h:347
static void filterPixelHorizontalVertical8BitPerChannel(const uint8_t *source, const unsigned int width, const unsigned int height, const unsigned int x, const unsigned int y, TTarget *response, const unsigned int sourcePaddingElements)
Horizontal and vertical Sobel filter for a pixel.
Definition FrameFilterSobel.h:803
PixelPositionT< T > west() const
Returns the pixel position west to this position.
Definition PixelPosition.h:558
unsigned int index(const unsigned int width) const
PixelPositionT< T > southWest() const
Returns the pixel position south west to this position.
Definition PixelPosition.h:564
PixelPositionT< T > north() const
Returns the pixel position north to this position.
Definition PixelPosition.h:546
bool isValid() const
Returns whether this pixel position object holds two valid parameters.
PixelPositionT< T > east() const
Returns the pixel position east to this position.
Definition PixelPosition.h:582
T y() const
Returns the vertical coordinate position of this object.
Definition PixelPosition.h:468
PixelPositionT< T > southEast() const
Returns the pixel position south east to this position.
Definition PixelPosition.h:576
T x() const
Returns the horizontal coordinate position of this object.
Definition PixelPosition.h:456
PixelPositionT< T > northWest() const
Returns the pixel position north west to this position.
Definition PixelPosition.h:552
PixelPositionT< T > south() const
Returns the pixel position south to this position.
Definition PixelPosition.h:570
PixelPositionT< T > northEast() const
Returns the pixel position north east to this position.
Definition PixelPosition.h:588
static PixelDirection direction(const PixelPositionT< unsigned int > &pixel0, const PixelPositionT< unsigned int > &pixel1)
static bool hasMaskNeighbor5(const T *mask, const unsigned int width, const unsigned int height, const unsigned int maskPaddingElements, const PixelPosition &position, const T testValue)
Determines whether at least one neighbor pixel in the 4-neighborhood (+ center pixel) is or is not a ...
Definition segmentation/MaskAnalyzer.h:844
static bool hasMaskNeighbor9(const T *mask, const unsigned int width, const unsigned int height, const unsigned int maskPaddingElements, const PixelPosition &position, const T testValue)
Determines whether at least one neighbor pixel in the 8-neighborhood (+ center pixel) is or is not a ...
Definition segmentation/MaskAnalyzer.h:987
static void findBorderPixels4(const uint8_t *mask, const unsigned int width, const unsigned int height, const unsigned int maskPaddingElements, PixelPositions &borderPixels, const PixelBoundingBox &boundingBox=PixelBoundingBox(), Worker *worker=nullptr, const uint8_t nonMaskValue=255u)
Determines all border pixels in an 8 bit mask frame for a 4-neighborhood.
static IndexPair32 patchAtBorder8BitPerChannel(const uint8_t *image0, const uint8_t *image1, const unsigned int width0, const unsigned int height0, const unsigned int width1, const unsigned int height1, const unsigned int centerX0, const unsigned int centerY0, const unsigned int centerX1, const unsigned int centerY1, const unsigned int image0PaddingElements, const unsigned int image1PaddingElements)
Returns the sum of square differences between two square image patches which can be partially outside...
Definition SumSquareDifferences.h:231
Initializer1(Layer &layer)
Creates a new initializer object.
Definition Initializer1.h:39
This class implements the base class for all synthesis initializers.
Definition Initializer.h:34
Layer & layer_
Synthesis layer that has to be initialized.
Definition Initializer.h:55
InitializerI(LayerI &layer)
Creates a new initializer object.
Definition InitializerI.h:45
LayerI & layerI_
Specialized layer reference.
Definition InitializerI.h:42
InitializerRandomized(Layer &layer, RandomGenerator &randomGenerator)
Creates a new initializer object.
Definition InitializerRandomized.h:46
This class implements a single inpainting pixel.
Definition InitializerShrinkingPatchMatchingI1.h:82
InpaintingPixel(const PixelPosition &position, const VectorI2 &borderDirection, const VectorI2 &imageOrientation)
Creates a new inpainting pixel by a given border direction and image orientation.
Definition InitializerShrinkingPatchMatchingI1.h:231
static VectorI2 determineImageOrientation5x5(const int16_t *sobelResponse, const uint8_t *mask, const unsigned int width, const unsigned int height, const unsigned int sobelStrideElements, const unsigned int maskPaddingElements, const CV::PixelPosition &position)
Determines the image orientation at a given position.
Definition InitializerShrinkingPatchMatchingI1.h:268
void setImageOrientation(const VectorI2 &orientation)
Sets the image orientation of this inpainting pixel.
Definition InitializerShrinkingPatchMatchingI1.h:261
bool operator<(const InpaintingPixel &right) const
Returns whether this inpainting pixel has a lower priority than a second one.
Definition InitializerShrinkingPatchMatchingI1.h:312
unsigned int priority_
Inpainting priority.
Definition InitializerShrinkingPatchMatchingI1.h:172
void setBorderDirection(const VectorI2 &direction)
Sets the border direction of this inpainting pixel.
Definition InitializerShrinkingPatchMatchingI1.h:255
static VectorI2 determineBorderDirection5x5(const uint8_t *mask, const unsigned int width, const unsigned int height, const unsigned int maskPaddingElements, const PixelPosition &position)
Determines the border direction of a border pixel by a 5x5 area.
const VectorI2 & imageOrientation() const
Returns the image orientation of this inpainting pixel.
Definition InitializerShrinkingPatchMatchingI1.h:245
bool operator==(const InpaintingPixel &right) const
Returns whether two inpainting pixels are identical.
Definition InitializerShrinkingPatchMatchingI1.h:328
const VectorI2 & borderDirection() const
Returns the border direction of this inpainting pixel.
Definition InitializerShrinkingPatchMatchingI1.h:240
VectorI2 imageOrientation_
Image orientation.
Definition InitializerShrinkingPatchMatchingI1.h:166
VectorI2 borderDirection_
Border direction.
Definition InitializerShrinkingPatchMatchingI1.h:169
unsigned int priority() const
Returns the priority of this inpainting pixel.
Definition InitializerShrinkingPatchMatchingI1.h:250
Definition of a wrapper class for ssd functions.
Definition InitializerShrinkingPatchMatchingI1.h:67
static unsigned int determine5x5(const uint8_t *frame, const uint8_t *mask, const unsigned int width, const unsigned int height, const unsigned int framePaddingElements, const unsigned int maskPaddingElements, const CV::PixelPosition &inPosition, const CV::PixelPosition &outPosition)
Wrapper function for SumSquareDifferences::patchAtBorder8BitPerChannel.
Definition InitializerShrinkingPatchMatchingI1.h:354
Definition of a wrapper class for ssd functions.
Definition InitializerShrinkingPatchMatchingI1.h:52
static unsigned int determine5x5(const uint8_t *frame, const uint8_t *mask, const unsigned int width, const unsigned int height, const unsigned int framePaddingElements, const unsigned int maskPaddingElements, const CV::PixelPosition &inPosition, const CV::PixelPosition &outPosition)
Wrapper function for AdvancedSumSquareDifferences::patchWithRejectingMask8BitPerChannel().
Definition InitializerShrinkingPatchMatchingI1.h:346
const unsigned int maximalBoundingBoxOffset_
Maximal search offset that is applied during the initialization for each inpainting pixel.
Definition InitializerShrinkingPatchMatchingI1.h:228
InitializerShrinkingPatchMatchingI1(LayerI1 &layer, RandomGenerator &randomGenerator, const unsigned int iterations=2u, const bool heuristic=false, const unsigned int maximalBoundingBoxOffset=0xFFFFFFFF)
Creates a new initializer object.
Definition InitializerShrinkingPatchMatchingI1.h:333
bool invoke(Worker *worker=nullptr) const override
Invokes the initialization process.
std::list< InpaintingPixel > InpaintingPixelList
Definition of a list holding inpainting pixels.
Definition InitializerShrinkingPatchMatchingI1.h:178
const bool heuristic_
Heuristic execution statement of the initializer.
Definition InitializerShrinkingPatchMatchingI1.h:225
bool invoke(Worker *worker) const
Invokes the initialization process.
bool patchInitializationIteration5x5(Frame &sobelResponse, const Frame &staticMask, RandomGenerator &randomGenerator) const
Applies the first iterations of the patch initialization for a frame using 5x5 areas.
Definition InitializerShrinkingPatchMatchingI1.h:360
const unsigned int iterations_
Number of initialization iterations.
Definition InitializerShrinkingPatchMatchingI1.h:222
This class implements a single layer for pixel synthesis within one frame and pixel accuracy.
Definition LayerI1.h:41
This class implements a mapping with integer accuracy.
Definition MappingI.h:33
const PixelPosition & position(const unsigned int x, const unsigned int y) const
Returns the mapping for a given position.
Definition MappingI.h:218
void setPosition(const unsigned int x, const unsigned int y, const PixelPosition &pixelPosition)
Sets a new mapping for a specified position.
Definition MappingI.h:240
This class implements Ocean's image class.
Definition Frame.h:1969
unsigned int strideElements(const unsigned int planeIndex=0u) const
Returns the number of elements within one row, including optional padding at the end of a row for a s...
Definition Frame.h:4315
const T * constdata(const unsigned int planeIndex=0u) const
Returns a pointer to the read-only pixel data of a specific plane.
Definition Frame.h:4425
T * data(const unsigned int planeIndex=0u)
Returns a pointer to the pixel data of a specific plane.
Definition Frame.h:4416
bool isValid() const
Returns whether this frame is valid.
Definition Frame.h:4705
const T * constpixel(const unsigned int x, const unsigned int y, const unsigned int planeIndex=0u) const
Returns the pointer to the constant data of a specific pixel.
Definition Frame.h:4507
@ ACM_COPY_REMOVE_PADDING_LAYOUT
Same as CM_COPY_REMOVE_PADDING_LAYOUT.
Definition Frame.h:1995
const T * constrow(const unsigned int y, const unsigned int planeIndex=0u) const
Returns the pointer to the constant data of a specific row.
Definition Frame.h:4450
unsigned int paddingElements(const unsigned int planeIndex=0u) const
Returns the optional number of padding elements at the end of each row for a specific plane.
Definition Frame.h:4299
static constexpr Scalar deg2rad(const Scalar deg)
static constexpr int32_t round32(const Scalar value)
This class implements a generator for random numbers.
Definition RandomGenerator.h:42
static unsigned int random(const unsigned int maxValue)
Returns one random integer value with specified maximum value.
static Scalar scalar(const Scalar lower, const Scalar upper)
const T & x() const noexcept
Returns the x value.
Definition Vector2.h:703
const T & y() const noexcept
Returns the y value.
Definition Vector2.h:715
const T & y() const noexcept
Returns the y value.
Definition Vector3.h:816
bool normalize()
Normalizes this vector.
Definition Vector3.h:651
const T & x() const noexcept
Returns the x value.
Definition Vector3.h:804
This class implements a worker able to distribute function calls over different threads.
Definition Worker.h:33
std::vector< PixelPosition > PixelPositions
Definition of a vector holding pixel positions (with positive coordinate values).
Definition PixelPosition.h:46
PixelPositionT< unsigned int > PixelPosition
Definition of the default PixelPosition object with a data type allowing only positive coordinate val...
Definition PixelPosition.h:32
PixelBoundingBoxT< unsigned int > PixelBoundingBox
Definition of the default PixelBoundingBox object with data type allowing only positive coordinate va...
Definition PixelBoundingBox.h:28
VectorT2< Scalar > Vector2
Definition of a 2D vector.
Definition Vector2.h:28
VectorT3< Scalar > Vector3
Definition of a 3D vector.
Definition Vector3.h:29
RotationT< Scalar > Rotation
Definition of the Rotation object, depending on the OCEAN_MATH_USE_SINGLE_PRECISION flag either with ...
Definition Rotation.h:32
VectorT2< int > VectorI2
Definition of a 2D vector with integer values.
Definition Vector2.h:49
float Scalar
Definition of a scalar type.
Definition Math.h:129
Namespace of the CV Synthesis library.
Definition Constraint.h:25
Namespace of the CV library.
Definition Advanced.h:17
The namespace covering the entire Ocean framework.
Definition Accessor.h:15