S732 数据同步

main
wangchongwu 4 weeks ago
parent 614bbd928a
commit 23f17ab0a7

@ -128,10 +128,10 @@
// 设置相机位置到瓦片区域
viewer.camera.setView({
destination: Cesium.Rectangle.fromDegrees(
109.398422,
40.873026,
109.398422,
40.873026,
109.484940,
40.877180,
109.484940,
40.877180,
),
orientation: {

@ -437,7 +437,7 @@ bool UnderStitch::FilterFrame(FrameInfo para)
}
// 扫描角过大,跳过
if (ABS(para.servoInfo.fServoPt) > 40)
if (ABS(para.servoInfo.fServoPt) > 45)
{
return false;
}

@ -2,5 +2,5 @@
#pragma once
#include <string>
std::string BUILD_TIME = "BUILD_TIME 2025_11_04-22.46.56";
std::string BUILD_TIME = "BUILD_TIME 2025_11_07-14.24.17";
std::string VERSION = "BUILD_VERSION 1.0.1";

@ -33,6 +33,15 @@ void ProcessVL(string filePath)
SINT32 nVLFrameSize = 1.5 * (S732_VL_W * S732_VL_H + S732_VL_W * PARA_VL_LINE_S732);
unsigned char* pFrameVL = new unsigned char[nVLFrameSize];
bool stitchInit = false;
std::deque<FrameInfo> infoBuffer;
const int delayFrames = 5; // 假设延迟3帧
std::deque<cv::Mat> MatBuffer;
const int matdelayFrames = 2; // 假设延迟3帧
while (!feof(file))
{
fread(pFrameVL, 1, nVLFrameSize, file);
@ -40,59 +49,81 @@ void ProcessVL(string filePath)
STD_DTArith_Record732 Paras_VL = { 0 };
memcpy(&Paras_VL, (unsigned char*)(pFrameVL + int(1.5 * S732_VL_W * S732_VL_H)), sizeof(STD_DTArith_Record732));
FrameInfo info = { 0 };
info.nFrmID = i;
FrameInfo info_rev = { 0 };
info_rev.nFrmID = i;
info.camInfo.fPixelSize = Paras_VL.trackInputPara.stCameraInfo.fPixelSize;
info_rev.camInfo.fPixelSize = Paras_VL.trackInputPara.stCameraInfo.fPixelSize;
info.camInfo.nFocus = Paras_VL.trackInputPara.stCameraInfo.nFocus;
info_rev.camInfo.nFocus = Paras_VL.trackInputPara.stCameraInfo.nFocus;
info.craft.stAtt.fYaw = Paras_VL.trackInputPara.stAirCraftInfo.stAtt.fYaw;
info.craft.stAtt.fPitch = Paras_VL.trackInputPara.stAirCraftInfo.stAtt.fPitch;
info.craft.stAtt.fRoll = Paras_VL.trackInputPara.stAirCraftInfo.stAtt.fRoll;
info_rev.craft.stAtt.fYaw = Paras_VL.trackInputPara.stAirCraftInfo.stAtt.fYaw;
info_rev.craft.stAtt.fPitch = Paras_VL.trackInputPara.stAirCraftInfo.stAtt.fPitch;
info_rev.craft.stAtt.fRoll = Paras_VL.trackInputPara.stAirCraftInfo.stAtt.fRoll;
info.craft.stPos.B = Paras_VL.trackInputPara.stAirCraftInfo.stPos.B;
info.craft.stPos.L = Paras_VL.trackInputPara.stAirCraftInfo.stPos.L;
info.craft.stPos.H = Paras_VL.trackInputPara.stAirCraftInfo.stPos.H;
info_rev.craft.stPos.B = Paras_VL.trackInputPara.stAirCraftInfo.stPos.B;
info_rev.craft.stPos.L = Paras_VL.trackInputPara.stAirCraftInfo.stPos.L;
info_rev.craft.stPos.H = Paras_VL.trackInputPara.stAirCraftInfo.stPos.H;
info_rev.nEvHeight = info_rev.craft.stPos.H - 1360;
info.nEvHeight = info.craft.stPos.H - 1360;
info_rev.servoInfo.fServoAz = Paras_VL.trackInputPara.stServoInfo.fServoAz;
info_rev.servoInfo.fServoPt = Paras_VL.trackInputPara.stServoInfo.fServoPt;
info.servoInfo.fServoAz = Paras_VL.trackInputPara.stServoInfo.fServoAz;
info.servoInfo.fServoPt = Paras_VL.trackInputPara.stServoInfo.fServoPt;
info_rev.nWidth = S732_VL_W;
info_rev.nHeight = S732_VL_H;
info.nWidth = S732_VL_W;
info.nHeight = S732_VL_H;
FrameInfo info = info_rev;
//info.craft.stAtt.fYaw += gr.generate();
//info.craft.stAtt.fPitch += gr.generate();
//info.craft.stAtt.fRoll += gr.generate();
cv::Mat mat_src(S732_VL_H * 1.5, S732_VL_W, CV_8UC1, pFrameVL);
cv::Mat IMG;
cv::cvtColor(mat_src, IMG, cv::COLOR_YUV2BGR_NV12);
cv::cvtColor(mat_src, IMG, cv::COLOR_YUV2GRAY_NV21);
cv::Mat f;
IMG.convertTo(f, CV_32F, 1.0 / 255.0);
cv::pow(f, 0.8, f); // gamma < 1 => 变亮
cv::Mat bright;
f.convertTo(bright, CV_8U, 255.0);
cv::cvtColor(bright, bright, cv::COLOR_GRAY2BGR);
cv::Mat IMG_show;
cv::resize(IMG, IMG_show, cv::Size(IMG.cols / 4, IMG.rows / 4));
imshow("IMG_show", IMG_show);
frame.enPixelFormat = GD_PIXEL_FORMAT_NV12;
MatBuffer.push_back(bright.clone());
if (MatBuffer.size() < matdelayFrames)
{
continue;
}
cv::Mat matuse = MatBuffer.front();
MatBuffer.pop_front();
frame.enPixelFormat = GD_PIXEL_FORMAT_RGB_PACKED;
frame.u32Width = S732_VL_W;
frame.u32Height = S732_VL_H;
frame.u64VirAddr[0] = pFrameVL;
frame.u64VirAddr[0] = matuse.data;
//imwrite("D:/imgVL_u.jpg", IMG);
if (i == 0 /*|| i == 200*/)
if (!stitchInit)
{
stitchInit = true;
stitcher->Init(info);
UPanConfig cfg = { 0 };
cfg.bOutGoogleTile = 1;
cfg.bOutFrameTile = 0;
cfg.bUseBA = 1;
stitcher->SetConfig(cfg);
stitcher->SetOutput("baotou","E:/google_tiles");
@ -102,7 +133,7 @@ void ProcessVL(string filePath)
mat_pan = cv::Mat(pan.u32Height, pan.u32Width, CV_8UC4, pan.u64VirAddr[0]);
output.open("E:/output.mp4", VideoWriter::fourcc('H', '2', '6', '4'), 5, Size(pan.u32Width / 8, pan.u32Height / 8), true);
output.open("E:/output.mp4", VideoWriter::fourcc('M', 'P', '4', 'V'), 25, Size(pan.u32Width / 8, pan.u32Height / 8), true);
if (!output.isOpened())
{
cout << "打开视频失败" << endl;
@ -126,41 +157,38 @@ void ProcessVL(string filePath)
cout << "time:" << tm.getTimeMilli() << endl;
}
Mat pan_rgb, pan_rgb_ds;
cv::cvtColor(mat_pan, pan_rgb, cv::COLOR_BGRA2BGR);
Mat pan_ds;
Mat pan_rgb_ds(cv::Size(mat_pan.cols / 8, mat_pan.rows / 8),CV_8UC3);
cv::resize(mat_pan, pan_ds, cv::Size(mat_pan.cols / 8, mat_pan.rows / 8));
cv::cvtColor(pan_ds, pan_rgb_ds, cv::COLOR_BGRA2BGR);
cv::resize(pan_rgb, pan_rgb_ds, cv::Size(pan_rgb.cols / 8, pan_rgb.rows / 8));
output.write(pan_rgb_ds);
imshow("pan_opt", pan_rgb_ds);
waitKey(1);
if (cv::waitKey(1) == 27)
{
break;
}
i = i + 1;
}
cv::TickMeter tm;
tm.start();
// 处理帧
stitcher->OptAndOutCurrPan();
tm.stop();
//cv::TickMeter tm;
//tm.start();
//// 处理帧
//stitcher->OptAndOutCurrPan();
cout << "time opt:" << tm.getTimeMilli() << endl;
//tm.stop();
//cout << "time opt:" << tm.getTimeMilli() << endl;
Mat pan_rgb, pan_rgb_ds;
cv::cvtColor(mat_pan, pan_rgb, cv::COLOR_BGRA2BGR);
cv::resize(pan_rgb, pan_rgb_ds, cv::Size(pan_rgb.cols / 8, pan_rgb.rows / 8));
for (int i = 0; i < 25; i++)
{
cv::putText(pan_rgb_ds, "BA opt", cv::Point(100, 40), 0, 1, cv::Scalar(255, 0, 0));
output.write(pan_rgb_ds);
}
waitKey(1);
@ -170,17 +198,8 @@ void ProcessVL(string filePath)
}
int main()
{
ProcessVL("D:/S732挂飞1101/20251101_091550742_2.yuv");
ProcessVL("D:/S732挂飞1101/20251101_092143724_3.yuv");
return 0;
}

@ -5,7 +5,7 @@ int main(int argc, char* argv[])
{
DecodeData* m_DecodeData = new DecodeData();
std::string filestr = "C:/Users/75929/Desktop/S732/1101VL.dat";
std::string filestr = "C:/Users/75929/Desktop/S732/1105.dat";
//std::string filestr = "E:/03855jcw/S732/H265data/1080ir2.dat";

Loading…
Cancel
Save