Format code

Signed-off-by: Jacki <jacki@thejackimonster.de>
This commit is contained in:
Jacki 2025-06-04 22:03:10 +02:00
parent d2ba6cbdf6
commit 4fe426913c
No known key found for this signature in database
GPG key ID: B404184796354C5E

View file

@ -1,18 +1,18 @@
#include <stdio.h>
#include <opencv2/opencv.hpp>
#include <opencv2/videoio.hpp>
#include <stdio.h>
const uint8_t chunk_map[128] = {
119, 54, 21, 0, 108, 22, 51, 63, 93, 99, 67, 7, 32, 112, 52, 43,
14, 35, 75, 116, 64, 71, 44, 89, 18, 88, 26, 61, 70, 56, 90, 79,
87, 120, 81, 101, 121, 17, 72, 31, 53, 124, 127, 113, 111, 36, 48,
19, 37, 83, 126, 74, 109, 5, 84, 41, 76, 30, 110, 29, 12, 115, 28,
102, 105, 62, 103, 20, 3, 68, 49, 77, 117, 125, 106, 60, 69, 98, 9,
16, 78, 47, 40, 2, 118, 34, 13, 50, 46, 80, 85, 66, 42, 123, 122,
96, 11, 25, 97, 39, 6, 86, 1, 8, 82, 92, 59, 104, 24, 15, 73, 65,
38, 58, 10, 23, 33, 55, 57, 107, 100, 94, 27, 95, 45, 91, 4, 114
};
119, 54, 21, 0, 108, 22, 51, 63, 93, 99, 67, 7, 32, 112, 52,
43, 14, 35, 75, 116, 64, 71, 44, 89, 18, 88, 26, 61, 70, 56,
90, 79, 87, 120, 81, 101, 121, 17, 72, 31, 53, 124, 127, 113, 111,
36, 48, 19, 37, 83, 126, 74, 109, 5, 84, 41, 76, 30, 110, 29,
12, 115, 28, 102, 105, 62, 103, 20, 3, 68, 49, 77, 117, 125, 106,
60, 69, 98, 9, 16, 78, 47, 40, 2, 118, 34, 13, 50, 46, 80,
85, 66, 42, 123, 122, 96, 11, 25, 97, 39, 6, 86, 1, 8, 82,
92, 59, 104, 24, 15, 73, 65, 38, 58, 10, 23, 33, 55, 57, 107,
100, 94, 27, 95, 45, 91, 4, 114};
#define CHUNK_SIZE 2400
#define CHUNK_AMOUNT 128
@ -185,7 +185,8 @@ cv::Point2f apply_fisheye624(float xn, float yn) {
return p;
}
cv::Mat build_maps_variant(apply_variant_func func, uint32_t width, uint32_t height) {
cv::Mat build_maps_variant(apply_variant_func func, uint32_t width,
uint32_t height) {
cv::Mat map = cv::Mat(cv::Size(height, width), CV_16SC2);
cv::Point2f p;
cv::Vec2s v;
@ -225,13 +226,9 @@ int main(int argc, const char** argv) {
cv::VideoCapture cap;
cv::Mat frame;
cv::Ptr<cv::StereoBM> stereo = cv::StereoBM::create(16, 15);
cv::Ptr<cv::StereoBM> stereo = nullptr; // cv::StereoBM::create(16, 15);
if (!stereo) {
return 1;
}
cap.open(4, cv::CAP_V4L2);
cap.open(0, cv::CAP_V4L2);
if (!cap.isOpened()) {
return 2;
}
@ -243,7 +240,8 @@ int main(int argc, const char** argv) {
cv::Mat left = cv::Mat(cv::Size(CAM_HEIGHT, CAM_WIDTH), CV_8UC1);
cv::Mat right = cv::Mat(cv::Size(CAM_HEIGHT, CAM_WIDTH), CV_8UC1);
cv::Mat map_fisheye624 = build_maps_variant(apply_fisheye624, CAM_WIDTH, CAM_HEIGHT);
cv::Mat map_fisheye624 =
build_maps_variant(apply_fisheye624, CAM_WIDTH, CAM_HEIGHT);
cv::Mat undist_left = cv::Mat(left.size(), left.type());
cv::Mat undist_right = cv::Mat(right.size(), right.type());