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
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);
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);
109 inline unsigned int priority()
const;
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);
204 template <
unsigned int tChannels>
216 template<
unsigned int tChannels,
typename SSD>
267template <
unsigned int tChannels>
270 static_assert(tChannels >= 1u,
"Invalid channel number!");
272 ocean_assert(sobelResponse !=
nullptr && mask !=
nullptr);
274 ocean_assert(sobelStrideElements >= width * 2u);
275 ocean_assert(position.
x() < width && position.
y() < height);
281 for (
unsigned int y = max(1,
int(position.
y()) - 2);
y < min(position.
y() + 3u, height - 1u); ++
y)
283 for (
unsigned int x = max(1,
int(position.
x()) - 2);
x < min(position.
x() + 3u, width - 1u); ++
x)
285 constexpr uint8_t nonMaskPixelValue = 0xFFu;
289 const int16_t*
const sobelPixel = sobelResponse +
y * sobelStrideElements +
x * tChannels * 2u;
291 for (
unsigned int n = 0u; n < tChannels; ++n)
293 const int16_t responseX = sobelPixel[n * 2u + 0u];
294 const int16_t responseY = sobelPixel[n * 2u + 1u];
298 orientation +=
VectorI2(responseX, responseY);
302 orientation -=
VectorI2(responseX, responseY);
345template <
unsigned int tChannels>
348 constexpr uint8_t maskValue = 0x00u;
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;
353template <
unsigned int tChannels>
356 return SumSquareDifferences::patchAtBorder8BitPerChannel<tChannels, 5u>(frame, frame, width, height, width, height, inPosition.
x(), inPosition.
y(), outPosition.
x(), outPosition.
y(), framePaddingElements, framePaddingElements).first;
359template<
unsigned int tChannels,
typename SSD>
362 static_assert(tChannels >= 1u,
"Invalid number of frame channels!");
368 const unsigned int width =
layer_.width();
369 const unsigned int height =
layer_.height();
377 for (
unsigned int y = 0; y < height; ++y)
379 for (
unsigned int x = 0; x < width; ++x)
383 ocean_assert(!position.
isValid() || (position.
x() < width && position.
y() < height));
390 uint8_t*
const frameData = frame.
data<uint8_t>();
394 const uint8_t*
const staticMaskData = staticMask.
constdata<uint8_t>();
395 const unsigned int staticMaskStrideElements = staticMask.
strideElements();
397 uint8_t*
const dynamicMaskData = dynamicMask.
data<uint8_t>();
398 const unsigned int dynamicMaskPaddingElements = dynamicMask.
paddingElements();
399 const unsigned int dynamicMaskStrideElements = dynamicMask.
strideElements();
401 int16_t*
const sobelResponseData = sobelResponse.
data<int16_t>();
402 const unsigned int sobelResponseStrideElements = sobelResponse.
strideElements();
405 borderPixels.reserve(1024);
415 inpaintingPixels.emplace_back(borderPixel, borderDirection, imageOrientation);
418 inpaintingPixels.sort();
420 while (!inpaintingPixels.empty())
423 ocean_assert(dynamicMask.
constpixel<uint8_t>(position.
x(), position.
y())[0] != 0xFF);
425 inpaintingPixels.pop_back();
427 unsigned int ssdBest = (
unsigned int)(-1);
429 unsigned int xBest = (
unsigned int)(-1);
430 unsigned int yBest = (
unsigned int)(-1);
439 for (
unsigned int y = max(0,
int(center.
y()) - 3); y < min(center.
y() + 4u, height); ++y)
441 for (
unsigned int x = max(0,
int(center.
x()) - 3); x < min(center.
x() + 4u, width); ++x)
443 if ((y != position.
y() || x != position.
x()) && staticMaskData[y * staticMaskStrideElements + x] == 0xFF)
445 const unsigned int ssd = SSD::template determine5x5<tChannels>(frameData, dynamicMaskData, width, height, framePaddingElements, dynamicMaskPaddingElements, position,
PixelPosition(x, y));
463 for (
unsigned int y = max(0,
int(east.
y()) - 3); y < min(east.
y() + 4u, height); ++y)
465 for (
unsigned int x = max(0,
int(east.
x()) - 3); x < min(east.
x() + 4u, width); ++x)
467 if ((y != position.
y() || x != position.
x()) && staticMaskData[y * staticMaskStrideElements + x] == 0xFF)
469 const unsigned int ssd = SSD::template determine5x5<tChannels>(frameData, dynamicMaskData, width, height, framePaddingElements, dynamicMaskPaddingElements, position,
PixelPosition(x, y));
487 for (
unsigned int y = max(0,
int(southEast.
y()) - 3); y < min(southEast.
y() + 4u, height); ++y)
489 for (
unsigned int x = max(0,
int(southEast.
x()) - 3); x < min(southEast.
x() + 4u, width); ++x)
491 if ((y != position.
y() || x != position.
x()) && staticMaskData[y * staticMaskStrideElements + x] == 0xFF)
493 const unsigned int ssd = SSD::template determine5x5<tChannels>(frameData, dynamicMaskData, width, height, framePaddingElements, dynamicMaskPaddingElements, position,
PixelPosition(x, y));
511 for (
unsigned int y = max(0,
int(south.
y()) - 3); y < min(south.
y() + 4u, height); ++y)
513 for (
unsigned int x = max(0,
int(south.
x()) - 3); x < min(south.
x() + 4u, width); ++x)
515 if ((y != position.
y() || x != position.
x()) && staticMaskData[y * staticMaskStrideElements + x] == 0xFF)
517 const unsigned int ssd = SSD::template determine5x5<tChannels>(frameData, dynamicMaskData, width, height, framePaddingElements, dynamicMaskPaddingElements, position,
PixelPosition(x, y));
535 for (
unsigned int y = max(0,
int(southWest.
y()) - 3); y < min(southWest.
y() + 4u, height); ++y)
537 for (
unsigned int x = max(0,
int(southWest.
x()) - 3); x < min(southWest.
x() + 4u, width); ++x)
539 if ((y != position.
y() || x != position.
x()) && staticMaskData[y * staticMaskStrideElements + x] == 0xFF)
541 const unsigned int ssd = SSD::template determine5x5<tChannels>(frameData, dynamicMaskData, width, height, framePaddingElements, dynamicMaskPaddingElements, position,
PixelPosition(x, y));
559 for (
unsigned int y = max(0,
int(west.
y()) - 3); y < min(west.
y() + 4u, height); ++y)
561 for (
unsigned int x = max(0,
int(west.
x()) - 3); x < min(west.
x() + 4u, width); ++x)
563 if ((y != position.
y() || x != position.
x()) && staticMaskData[y * staticMaskStrideElements + x] == 0xFF)
565 const unsigned int ssd = SSD::template determine5x5<tChannels>(frameData, dynamicMaskData, width, height, framePaddingElements, dynamicMaskPaddingElements, position,
PixelPosition(x, y));
583 for (
unsigned int y = max(0,
int(northWest.
y()) - 3); y < min(northWest.
y() + 4u, height); ++y)
585 for (
unsigned int x = max(0,
int(northWest.
x()) - 3); x < min(northWest.
x() + 4u, width); ++x)
587 if ((y != position.
y() || x != position.
x()) && staticMaskData[y * staticMaskStrideElements + x] == 0xFF)
589 const unsigned int ssd = SSD::template determine5x5<tChannels>(frameData, dynamicMaskData, width, height, framePaddingElements, dynamicMaskPaddingElements, position,
PixelPosition(x, y));
607 for (
unsigned int y = max(0,
int(north.
y()) - 3); y < min(north.
y() + 4u, height); ++y)
609 for (
unsigned int x = max(0,
int(north.
x()) - 3); x < min(north.
x() + 4u, width); ++x)
611 if ((y != position.
y() || x != position.
x()) && staticMaskData[y * staticMaskStrideElements + x] == 0xFF)
613 const unsigned int ssd = SSD::template determine5x5<tChannels>(frameData, dynamicMaskData, width, height, framePaddingElements, dynamicMaskPaddingElements, position,
PixelPosition(x, y));
631 for (
unsigned int y = max(0,
int(northEast.
y()) - 3); y < min(northEast.
y() + 4u, height); ++y)
633 for (
unsigned int x = max(0,
int(northEast.
x()) - 3); x < min(northEast.
x() + 4u, width); ++x)
635 if ((y != position.
y() || x != position.
x()) && staticMaskData[y * staticMaskStrideElements + x] == 0xFF)
637 const unsigned int ssd = SSD::template determine5x5<tChannels>(frameData, dynamicMaskData, width, height, framePaddingElements, dynamicMaskPaddingElements, position,
PixelPosition(x, y));
655 for (
unsigned int n = 0u; n < 100u; ++n)
659 const Vector3 offset = rotation * normal * length;
662 if (first.
x() < width && first.
y() < height && staticMaskData[first.
y() * staticMaskStrideElements + first.
x()] == 0xFF)
664 const unsigned int ssd = SSD::template determine5x5<tChannels>(frameData, dynamicMaskData, width, height, framePaddingElements, dynamicMaskPaddingElements, position, first);
676 if (second.
x() < width && second.
y() < height && staticMaskData[second.
y() * staticMaskStrideElements + second.
x()] == 0xFF)
678 const unsigned int ssd = SSD::template determine5x5<tChannels>(frameData, dynamicMaskData, width, height, framePaddingElements, dynamicMaskPaddingElements, position, second);
691 if (ssdBest != (
unsigned int)(-1))
693 const unsigned int iterations = 200u;
694 for (
unsigned int n = 0u; n < iterations; ++n)
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);
699 const int offsetX =
RandomI::random(randomGenerator, -xRadius, xRadius);
700 const int offsetY =
RandomI::random(randomGenerator, -yRadius, yRadius);
702 const unsigned int randomX = xBest + offsetX;
703 const unsigned int randomY = yBest + offsetY;
705 if (randomX < width && randomY < height && (randomY != position.
y() || randomX != position.
x()) && staticMaskData[randomY * staticMaskStrideElements + randomX] == 0xFF)
707 const unsigned int ssd = SSD::template determine5x5<tChannels>(frameData, dynamicMaskData, width, height, framePaddingElements, dynamicMaskPaddingElements, position,
CV::PixelPosition(randomX, randomY));
721 if (ssdBest == (
unsigned int)(-1))
726 for (
unsigned int y = 0u; y < height; ++y)
728 const uint8_t*
const staticMaskRow = staticMask.
constrow<uint8_t>(y);
730 for (
unsigned int x = 0u; x < width; ++x)
732 if ((y != position.
y() || x != position.
x()) && staticMaskRow[x] == 0xFF)
734 const unsigned int ssd = SSD::template determine5x5<tChannels>(frameData, dynamicMaskData, width, height, framePaddingElements, dynamicMaskPaddingElements, position,
CV::PixelPosition(x, y));
756 for (
unsigned int y = top; y < bottomEnd; ++y)
758 for (
unsigned int x = left; x < rightEnd; ++x)
760 if ((y != position.
y() || x != position.
x()) && staticMaskData[y * staticMaskStrideElements + x] == 0xFF)
762 const unsigned int ssd = SSD::template determine5x5<tChannels>(frameData, dynamicMaskData, width, height, framePaddingElements, dynamicMaskPaddingElements, position,
CV::PixelPosition(x, y));
777 if (ssdBest == (
unsigned int)(-1))
782 for (
unsigned int y = 0u; ssdBest == (
unsigned int)(-1) && y < height; ++y)
784 const uint8_t* staticMaskRow = staticMask.
constrow<uint8_t>(y);
786 for (
unsigned int x = 0u; x < width; ++x)
788 if (staticMaskRow[x] == 0xFFu)
790 ssdBest = (
unsigned int)(-2);
801 if (ssdBest == (
unsigned int)(-1))
806 ocean_assert(xBest < width && yBest < height);
811 for (
unsigned int y = max(0,
int(position.
y()) - 1); y < min(position.
y() + 2u, height); ++y)
813 for (
unsigned int x = max(0,
int(position.
x()) - 1); x < min(position.
x() + 2u, width); ++x)
821 newBorderPixels.reserve(4u);
823 constexpr uint8_t nonMaskPixelValue = 0xFF;
826 if (position.
x() - 1u < width - 2u)
831 newBorderPixels.emplace_back(position.
north());
837 newBorderPixels.emplace_back(position.
south());
841 if (position.
y() - 1u < height - 2u)
846 newBorderPixels.emplace_back(position.
west());
852 newBorderPixels.emplace_back(position.
east());
862 ocean_assert(newBorerPixel != inpaintingPixel);
869 ocean_assert(dynamicMask.
constpixel<uint8_t>(position.
x(), position.
y())[0] != 0xFFu);
870 ocean_assert(staticMask.
constpixel<uint8_t>(xBest, yBest)[0] == 0xFFu);
872 dynamicMaskData[position.
y() * dynamicMaskStrideElements + position.
x()] = 0xFFu;
879 for (InpaintingPixelList::iterator i = inpaintingPixels.begin(); i != inpaintingPixels.end(); )
881 ocean_assert(*i != position);
884 const int dx = abs(
int(i->x()) -
int(position.
x()));
885 const int dy = abs(
int(i->y()) -
int(position.
y()));
887 if (dx <= 3 && dy <= 3)
890 changedInpaintingPixels.emplace_back(*i,
InpaintingPixel::determineBorderDirection5x5(dynamicMaskData, width, height, dynamicMaskPaddingElements, *i),
InpaintingPixel::determineImageOrientation5x5<tChannels>(sobelResponseData, dynamicMaskData, width, height, sobelResponseStrideElements, dynamicMaskPaddingElements, *i));
892 i = inpaintingPixels.erase(i);
903 changedInpaintingPixels.emplace_back(newBorderPixel,
InpaintingPixel::determineBorderDirection5x5(dynamicMaskData, width, height, dynamicMaskPaddingElements, newBorderPixel),
InpaintingPixel::determineImageOrientation5x5<tChannels>(sobelResponseData, dynamicMaskData, width, height, sobelResponseStrideElements, dynamicMaskPaddingElements, newBorderPixel));
906 changedInpaintingPixels.sort();
907 inpaintingPixels.merge(changedInpaintingPixels);
912 ocean_assert(inpaintingPixel ==
InpaintingPixel(inpaintingPixel,
InpaintingPixel::determineBorderDirection5x5(dynamicMaskData, width, height, dynamicMaskPaddingElements, inpaintingPixel),
InpaintingPixel::determineImageOrientation5x5<tChannels>(sobelResponseData, dynamicMaskData, width, height, sobelResponseStrideElements, dynamicMaskPaddingElements, inpaintingPixel)));
918 for (
unsigned int y = 0; y < height; ++y)
920 for (
unsigned int x = 0; x < width; ++x)
922 ocean_assert(dynamicMask.
constpixel<uint8_t>(x, y)[0] == 0xFFu);
925 if (staticMask.
constpixel<uint8_t>(x, y)[0] != 0xFFu)
927 ocean_assert(position.
isValid() && position.
x() < width && position.
y() < height);
931 ocean_assert(!position.
isValid());
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