[wpiutil,cscore,apriltag] Fix RawFrame (#6098)

This commit is contained in:
Peter Johnson
2023-12-26 20:05:02 -08:00
committed by GitHub
parent 8aeee03626
commit 5659038443
18 changed files with 537 additions and 317 deletions

View File

@@ -72,6 +72,23 @@ class Image {
return cv::Mat{height, width, type, m_data.data()};
}
int GetStride() const {
switch (pixelFormat) {
case VideoMode::kYUYV:
case VideoMode::kRGB565:
case VideoMode::kY16:
case VideoMode::kUYVY:
return 2 * width;
case VideoMode::kBGR:
return 3 * width;
case VideoMode::kGray:
return width;
case VideoMode::kMJPEG:
default:
return 0;
}
}
cv::_InputArray AsInputArray() { return cv::_InputArray{m_data}; }
bool Is(int width_, int height_) {