MCPcopy Create free account
hub / github.com/HyperInspire/InspireFace / test_resize

Function test_resize

cpp/sample/cpp_api/cpp_nexus_process.cpp:6–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4#include <inspireface/image_process/nexus_processor/image_processor.h>
5
6void test_resize(std::unique_ptr<inspire::nexus::ImageProcessor>& processor, int aligned_width) {
7 processor->SetAlignedWidth(aligned_width);
8 // Create image
9 inspirecv::Image img = inspirecv::Image::Create("kun.jpg", 3);
10 // Resize image
11 uint8_t* dst_data = nullptr;
12 int dst_width = 112;
13 int dst_height = 112;
14 processor->Resize(img.Data(), img.Width(), img.Height(), 3, &dst_data, dst_width, dst_height);
15 inspirecv::Image dst_img(dst_width, dst_height, 3, dst_data, false);
16 dst_img.Write("dst_w" + std::to_string(aligned_width) + ".jpg");
17 std::cout << "Save dst image to dst_w" << aligned_width << ".jpg" << std::endl;
18}
19
20int main() {
21 // Create image processor

Callers 1

mainFunction · 0.85

Calls 2

SetAlignedWidthMethod · 0.45
ResizeMethod · 0.45

Tested by

no test coverage detected