|
|
|
@ -222,7 +222,7 @@ void ProcessIR(string filePath, string outname)
|
|
|
|
|
void ProcessVL(string filePath,string outname)
|
|
|
|
|
{
|
|
|
|
|
auto stitcher = API_UnderStitch::Create();
|
|
|
|
|
stitcher->SetOutput(outname, "D:/google_tiles");
|
|
|
|
|
stitcher->SetOutput(outname, "google_tiles");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GD_VIDEO_FRAME_S frame = { 0 };//输入帧
|
|
|
|
@ -232,7 +232,7 @@ void ProcessVL(string filePath,string outname)
|
|
|
|
|
|
|
|
|
|
FILE* file = fopen(filePath.c_str(), "rb");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cv::VideoWriter output;
|
|
|
|
|
GaussianRandom gr(0.0, 1, 0.0);
|
|
|
|
|
|
|
|
|
|
int i = 0;
|
|
|
|
@ -290,12 +290,12 @@ void ProcessVL(string filePath,string outname)
|
|
|
|
|
|
|
|
|
|
mat_pan = cv::Mat(pan.u32Height, pan.u32Width, CV_8UC4, pan.u64VirAddr[0]);
|
|
|
|
|
|
|
|
|
|
//output.open("D:/output.mp4", VideoWriter::fourcc('H', '2', '6', '4'), 25, Size(pan.u32Width, pan.u32Height), true);
|
|
|
|
|
//if (!output.isOpened())
|
|
|
|
|
//{
|
|
|
|
|
// cout << "打开视频失败" << endl;
|
|
|
|
|
// return;
|
|
|
|
|
//}
|
|
|
|
|
output.open("D:/output.mp4", VideoWriter::fourcc('H', '2', '6', '4'), 25, Size(pan.u32Width, pan.u32Height), true);
|
|
|
|
|
if (!output.isOpened())
|
|
|
|
|
{
|
|
|
|
|
cout << "打开视频失败" << endl;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
@ -318,7 +318,7 @@ void ProcessVL(string filePath,string outname)
|
|
|
|
|
|
|
|
|
|
cout << "time:" << tm.getTimeMilli() << endl;
|
|
|
|
|
|
|
|
|
|
//output.write(mat_pan);
|
|
|
|
|
output.write(mat_pan);
|
|
|
|
|
|
|
|
|
|
// 接收帧
|
|
|
|
|
//auto a = stitcher->ReceiveFrame(frame, info);
|
|
|
|
@ -329,6 +329,8 @@ void ProcessVL(string filePath,string outname)
|
|
|
|
|
cv::resize(mat_pan, res, cv::Size(pan.u32Width / 4, pan.u32Height / 4));
|
|
|
|
|
imshow("pan_opt", res);
|
|
|
|
|
|
|
|
|
|
output.release();
|
|
|
|
|
|
|
|
|
|
waitKey(1);
|
|
|
|
|
|
|
|
|
|
i = i + 1;
|
|
|
|
@ -371,7 +373,7 @@ void ProcessFrontVL(string filePath)
|
|
|
|
|
|
|
|
|
|
SINT32 nVLFrameSize = 1.5 * IMAGE_WIDTH_VL * IMAGE_HEIGHT_VL + IMAGE_WIDTH_VL * PARA_IR_LINE;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cv::VideoWriter output;
|
|
|
|
|
|
|
|
|
|
int i = 0;
|
|
|
|
|
while (!feof(file))
|
|
|
|
@ -409,9 +411,9 @@ void ProcessFrontVL(string filePath)
|
|
|
|
|
info.craft.stAtt.fRoll += gr.generate();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//cv::Mat mat_src(IMAGE_HEIGHT_VL * 1.5, IMAGE_WIDTH_VL, CV_8UC1, pFrameVL);
|
|
|
|
|
//cv::Mat IMG;
|
|
|
|
|
//cv::cvtColor(mat_src, IMG, cv::COLOR_YUV2BGR_NV12);
|
|
|
|
|
cv::Mat mat_src(IMAGE_HEIGHT_VL * 1.5, IMAGE_WIDTH_VL, CV_8UC1, pFrameVL);
|
|
|
|
|
cv::Mat IMG;
|
|
|
|
|
cv::cvtColor(mat_src, IMG, cv::COLOR_YUV2BGR_NV12);
|
|
|
|
|
|
|
|
|
|
//imshow("src", IMG);
|
|
|
|
|
//waitKey(1);
|
|
|
|
@ -423,11 +425,19 @@ void ProcessFrontVL(string filePath)
|
|
|
|
|
|
|
|
|
|
if (i == 0)
|
|
|
|
|
{
|
|
|
|
|
stitcher->Init(info, ScanRange{0,100}, ScanRange{ 56,90 });
|
|
|
|
|
stitcher->Init(info, ScanRange{-10,100}, ScanRange{ 56,90 });
|
|
|
|
|
|
|
|
|
|
pan = stitcher->ExportPanAddr();
|
|
|
|
|
|
|
|
|
|
mat_pan = cv::Mat(pan.u32Height, pan.u32Width, CV_8UC3, pan.u64VirAddr[0]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
output.open("F:/output.mp4", VideoWriter::fourcc('H', '2', '6', '4'), 5, Size(pan.u32Width/4, pan.u32Height/4), true);
|
|
|
|
|
if (!output.isOpened())
|
|
|
|
|
{
|
|
|
|
|
cout << "打开视频失败" << endl;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
@ -454,10 +464,21 @@ void ProcessFrontVL(string filePath)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 定义大图的 ROI(左上角区域)
|
|
|
|
|
cv::Mat roi = mat_pan(cv::Rect(0, 0, frame.u32Width, frame.u32Height));
|
|
|
|
|
|
|
|
|
|
// 将小图复制到 ROI
|
|
|
|
|
IMG.copyTo(roi);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cv::Mat res;
|
|
|
|
|
cv::resize(mat_pan, res, cv::Size(pan.u32Width / 4, pan.u32Height / 4));
|
|
|
|
|
imshow("pan_opt", res);
|
|
|
|
|
|
|
|
|
|
output << res;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
waitKey(1);
|
|
|
|
|
i = i + 1;
|
|
|
|
|
}
|
|
|
|
@ -468,6 +489,8 @@ void ProcessFrontVL(string filePath)
|
|
|
|
|
cv::resize(mat_pan, res, cv::Size(pan.u32Width / 4, pan.u32Height / 4));
|
|
|
|
|
imshow("pan_opt", res);
|
|
|
|
|
|
|
|
|
|
output.release();
|
|
|
|
|
|
|
|
|
|
waitKey(0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -477,12 +500,12 @@ void ProcessFrontVL(string filePath)
|
|
|
|
|
int main(int, char**)
|
|
|
|
|
{
|
|
|
|
|
//ProcessIR("H:/ir_1280_1024_para40_y16/20241219155238_20.xraw", "20241219155238_20");
|
|
|
|
|
//ProcessVL("H:/vl_1920_1080_para40_y8/22.video","22");
|
|
|
|
|
//ProcessVL("/home/wang/22.video","22");
|
|
|
|
|
//ProcessVL("H:/vl_1920_1080_para40_y8/20241219153557_11.video", "20241219152643_1");
|
|
|
|
|
//ProcessVL("H:/vl_1920_1080_para40_y8/20241219152917_4.video", "20241219152917_4");
|
|
|
|
|
//ProcessVL("H:/vl_1920_1080_para40_y8/20241219153515_10.video", "20241219153515_10");
|
|
|
|
|
//
|
|
|
|
|
//ProcessVL("H:/vl_1920_1080_para40_y8/1.video", "1");
|
|
|
|
|
ProcessVL("H:/vl_1920_1080_para40_y8/1.video", "1");
|
|
|
|
|
|
|
|
|
|
ProcessFrontVL("H:/vl_1920_1080_para40_y8/20241219152917_4.video");
|
|
|
|
|
//ProcessFrontVL("H:/vl_1920_1080_para40_y8/1.video");
|
|
|
|
|
}
|