You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.8 KiB
46 lines
1.8 KiB
#include <memory>
|
|
#include "S3315.h"
|
|
#include <cmath>
|
|
#include <cstring>
|
|
#include <iostream>
|
|
#include < iomanip >
|
|
|
|
/**
|
|
* @brief
|
|
* 根据密位返回角度
|
|
*
|
|
* @param mil 密位
|
|
* @param mil_type 6000
|
|
*
|
|
* @return 返回当前密位对应的角度
|
|
*/
|
|
float calc_fov_by_mil(float mil, int mil_type)
|
|
{
|
|
return (mil * 360.0f / mil_type);
|
|
}
|
|
|
|
void S3315GetImagePara(unsigned char* pParamDataBuffer, unsigned char* pResultDataBuffer, ARIDLL_INPUTPARA* ImagePara)
|
|
{
|
|
ST_3315_152_NO110* pParamNO110DataBuffer = (ST_3315_152_NO110*)calloc(640, sizeof(int));
|
|
ST_3315_152_NO149* pParamNO149DataBuffer = (ST_3315_152_NO149*)calloc(640, sizeof(int));
|
|
ST_3315_152_NO65* pParamNO65DataBuffer = (ST_3315_152_NO65*)calloc(640, sizeof(int));
|
|
unsigned char* IR_para = { 0 };
|
|
//memcpy(IR_para, pParamDataBuffer, 1280);
|
|
memcpy(pParamNO110DataBuffer, pParamDataBuffer, 640);
|
|
memcpy(pParamNO149DataBuffer, pParamDataBuffer+ 640, 640);
|
|
memcpy(pParamNO65DataBuffer, pParamDataBuffer + 1280, 640);
|
|
ImagePara->stServoInfo.fServoAz = calc_fov_by_mil(pParamNO65DataBuffer->B1B0 , 6000) * 6000.0f / 65536.0f;
|
|
ImagePara->stServoInfo.fServoPt = calc_fov_by_mil(pParamNO65DataBuffer->B3B2, 6000) * 6000.0f / 65536.0f;
|
|
ImagePara->stCameraInfo.fPixelSize = 25;
|
|
ImagePara->stCameraInfo.nFocus = 302;
|
|
ImagePara->unFreq = 50;
|
|
/*std::cout << std::hex << std::setw(8) << "pParamDataBuffer" << std::setfill('0') << reinterpret_cast<std::uintptr_t>(pParamDataBuffer) << ": ";
|
|
for (int i = 0; i < 640; ++i)
|
|
{
|
|
std::cout << std::hex << std::setw(4) << std::setfill('0') << static_cast<int>(pParamDataBuffer[1280+i]) << " " ;
|
|
}
|
|
std::cout << std::endl;*/
|
|
//int w = uint8_t(pParamDataBuffer[20]);
|
|
// ImagePara->stServoInfo.fServoAz = pParamDataBuffer[258];
|
|
//ImagePara->stServoInfo.fServoPt = pParamDataBuffer[259];
|
|
} |