MCPcopy Create free account
hub / github.com/ARM-software/armnn / ResizeFrame

Function ResizeFrame

samples/ObjectDetection/src/ImageUtils.cpp:89–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87
88
89void ResizeFrame(const cv::Mat& frame, cv::Mat& dest, const common::Size& aspectRatio)
90{
91 if(&dest != &frame)
92 {
93 double longEdgeInput = std::max(frame.rows, frame.cols);
94 double longEdgeOutput = std::max(aspectRatio.m_Width, aspectRatio.m_Height);
95 const double resizeFactor = longEdgeOutput/longEdgeInput;
96 cv::resize(frame, dest, cv::Size(0, 0), resizeFactor, resizeFactor, DefaultResizeFlag);
97 }
98 else
99 {
100 const std::string warningMessage{"Resize was not performed because resized frame references the source frame."};
101 ARMNN_LOG(warning) << warningMessage;
102 }
103}
104
105/** Pad a frame with zeros (add rows and columns to the end) */
106void PadFrame(const cv::Mat& src, cv::Mat& dest, const int bottom, const int right)

Callers 1

ResizeWithPadFunction · 0.85

Calls 1

SizeClass · 0.85

Tested by

no test coverage detected