Internal change
PiperOrigin-RevId: 525030969
This commit is contained in:
parent
43fd744296
commit
63cd09951d
|
@ -56,8 +56,8 @@ bool NormalizedtoPixelCoordinates(double normalized_x, double normalized_y,
|
|||
VLOG(1) << "Normalized coordinates must be between 0.0 and 1.0";
|
||||
}
|
||||
|
||||
*x_px = static_cast<int32>(round(normalized_x * image_width));
|
||||
*y_px = static_cast<int32>(round(normalized_y * image_height));
|
||||
*x_px = static_cast<int32_t>(round(normalized_x * image_width));
|
||||
*y_px = static_cast<int32_t>(round(normalized_y * image_height));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -43,14 +43,14 @@ mediapipe::ImageFormat::Format GetImageFormat(int image_channels) {
|
|||
|
||||
Packet MakeImageFramePacket(cv::Mat input, int timestamp) {
|
||||
ImageFrame input_image(GetImageFormat(input.channels()), input.cols,
|
||||
input.rows, input.step, input.data, [](uint8*) {});
|
||||
input.rows, input.step, input.data, [](uint8_t*) {});
|
||||
return MakePacket<ImageFrame>(std::move(input_image)).At(Timestamp(0));
|
||||
}
|
||||
|
||||
Packet MakeImagePacket(cv::Mat input, int timestamp) {
|
||||
mediapipe::Image input_image(std::make_shared<mediapipe::ImageFrame>(
|
||||
GetImageFormat(input.channels()), input.cols, input.rows, input.step,
|
||||
input.data, [](uint8*) {}));
|
||||
input.data, [](uint8_t*) {}));
|
||||
return MakePacket<mediapipe::Image>(std::move(input_image)).At(Timestamp(0));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user