DEM :地理坐标与投影坐标系转换
parent
6b1c5f6960
commit
7c58127fcf
|
@ -0,0 +1,41 @@
|
|||
/**
|
||||
* @file dialogimportmodeldataset.cpp
|
||||
* @brief None
|
||||
* @author 陈增辉 (3045316072@qq.com)
|
||||
* @version 2.5.0
|
||||
* @date 24-6-25
|
||||
* @copyright Copyright (c) Since 2024 中科卫星应用研究院 All rights reserved.
|
||||
*/
|
||||
|
||||
// You may need to build the project (run Qt uic code generator) to get
|
||||
// "ui_DialogImportModelDataset.h" resolved
|
||||
|
||||
#include "dialogimportmodeldataset.h"
|
||||
#include "ui_dialogimportmodeldataset.h"
|
||||
#include "Settings/BusAPI.h"
|
||||
|
||||
|
||||
namespace WBFZ {
|
||||
DialogImportModelDataset::DialogImportModelDataset(QWidget* parent)
|
||||
: QDialog(parent)
|
||||
, ui(new Ui::DialogImportModelDataset)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
DialogImportModelDataset::~DialogImportModelDataset()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
// 初始化模型库
|
||||
void DialogImportModelDataset::initLibrary() {
|
||||
|
||||
Setting::BusAPI* busapi=Setting::BusAPI::instance();
|
||||
QString executablePath = QApplication::applicationDirPath(); // exe 路径
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
} // namespace WBFZ
|
|
@ -0,0 +1,42 @@
|
|||
/**
|
||||
* @file dialogimportmodeldataset.h
|
||||
* @brief None
|
||||
* @author 陈增辉 (3045316072@qq.com)
|
||||
* @version 2.5.0
|
||||
* @date 24-6-25
|
||||
* @copyright Copyright (c) Since 2024 中科卫星应用研究院 All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef LAMPCAE_DIALOGIMPORTMODELDATASET_H
|
||||
#define LAMPCAE_DIALOGIMPORTMODELDATASET_H
|
||||
|
||||
#include <QDialog>
|
||||
#include "ModuleBase/graph3DWindow.h"
|
||||
#include
|
||||
|
||||
|
||||
namespace WBFZ {
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace Ui {
|
||||
class DialogImportModelDataset;
|
||||
}
|
||||
QT_END_NAMESPACE
|
||||
|
||||
class DialogImportModelDataset : public QDialog {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit DialogImportModelDataset(QWidget* parent = nullptr);
|
||||
~DialogImportModelDataset() override;
|
||||
|
||||
public:
|
||||
void initLibrary();
|
||||
void filterModel();// 根据条件筛选
|
||||
|
||||
private:
|
||||
Ui::DialogImportModelDataset* ui;
|
||||
QString _librarySettingPath; // ini 配置环境地址
|
||||
};
|
||||
} // namespace WBFZ
|
||||
|
||||
#endif // LAMPCAE_DIALOGIMPORTMODELDATASET_H
|
|
@ -0,0 +1,155 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>WBFZ::DialogImportModelDataset</class>
|
||||
<widget class="QDialog" name="WBFZ::DialogImportModelDataset">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1003</width>
|
||||
<height>805</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>DialogImportModelDataset</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QFrame" name="frame">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>350</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>350</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QFrame" name="frame_3">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="comboBox">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>预制模型类型</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="frame_4">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<widget class="QListWidget" name="listWidget">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>300</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>300</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="frame_2">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QWidget" name="modelViewContent" native="true">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>600</width>
|
||||
<height>600</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>1000</width>
|
||||
<height>1000</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
|
@ -0,0 +1,216 @@
|
|||
/**
|
||||
* @file DEM2PointCloudTemplateFun.h
|
||||
* @brief DEM转点云的匿名函数
|
||||
* @author 陈增辉 (3045316072@qq.com)
|
||||
* @version 2.5.0
|
||||
* @date 24-6-19
|
||||
* @copyright Copyright (c) Since 2024 中科卫星应用研究院 All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef LAMPCAE_DEM2POINTCLOUDTEMPLATEFUN_H
|
||||
#define LAMPCAE_DEM2POINTCLOUDTEMPLATEFUN_H
|
||||
|
||||
#include "DEM2PointCloud.h"
|
||||
#include "RasterToolBase.h"
|
||||
#include "RasterDataClass.h"
|
||||
|
||||
#include <QString>
|
||||
#include <QDebug>
|
||||
|
||||
|
||||
namespace LAMPToolBox{
|
||||
|
||||
template<class T>
|
||||
bool DEM2PointCloud_project(RasterToolBase::RasterDataClass rasterdatades,QString out_plygon){
|
||||
qDebug()<<"bool DEM2PointCloud_project(RasterToolBase::RasterDataClass rasterdatades,QString out_plygon)";
|
||||
QString _inDEMPath=rasterdatades.getFilepath();
|
||||
|
||||
// 创建文件对象
|
||||
QFile file(out_plygon);
|
||||
// 打开文件,如果打开失败则输出错误信息并返回
|
||||
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
||||
qDebug() << "Could not open file for writing.";
|
||||
return 1;
|
||||
}
|
||||
QTextStream out(&file);
|
||||
if(RasterToolBase::GDALAllRegisterEnable){
|
||||
|
||||
}else{
|
||||
GDALAllRegister();
|
||||
RasterToolBase::GDALAllRegisterEnable=true;
|
||||
}
|
||||
|
||||
CPLSetConfigOption("GDAL_FILENAME_IS_UTF8", "YES"); // 注册GDAL驱动
|
||||
GDALDataset *poDataset;
|
||||
poDataset = (GDALDataset *)GDALOpen(_inDEMPath.toUtf8().data(), GA_ReadOnly);
|
||||
{
|
||||
if(NULL == poDataset) {
|
||||
return false;
|
||||
}
|
||||
GDALRasterBand *poBand = poDataset->GetRasterBand(1);
|
||||
|
||||
// 仿射矩阵
|
||||
double gt[6];
|
||||
poDataset->GetGeoTransform(gt);
|
||||
|
||||
// 分块处理
|
||||
long block_row_len=5000;
|
||||
long block_col_len=5000;
|
||||
RasterToolBase::RasterDataSplitBlockParams blockParams(rasterdatades.getHeight(),rasterdatades.getWidth(),5000,5000);
|
||||
|
||||
long start_row=0;
|
||||
long start_col=0;
|
||||
long RowLen=0;
|
||||
long ColLen=0;
|
||||
T* datablock=new T[block_row_len*block_col_len];
|
||||
double x,y,z;
|
||||
for(long id=0;id<blockParams.getBlockCount();id++){
|
||||
blockParams.getBlockParams(start_row,start_col,RowLen,ColLen,id);
|
||||
if(RowLen!=block_row_len||ColLen!=block_col_len){
|
||||
delete datablock; // 释放之后重新释放
|
||||
datablock=new T[block_row_len*block_col_len];
|
||||
poBand->RasterIO(GF_Read, start_col, start_row, ColLen, RowLen, datablock, ColLen, RowLen, rasterdatades.getDataType(), 0, 0);
|
||||
}else{
|
||||
poBand->RasterIO(GF_Read, start_col, start_row, ColLen, RowLen, datablock, ColLen, RowLen, rasterdatades.getDataType(), 0, 0);
|
||||
}
|
||||
// 计算坐标,并输出
|
||||
for(long i=0;i<RowLen;i++){
|
||||
for(long j=0;j<ColLen;j++){
|
||||
x = gt[0] + gt[1] * (j+start_col) + gt[2] * (i+start_row);
|
||||
y = gt[3] + gt[4] * (j+start_col) + gt[5] * (i+start_row);
|
||||
z=datablock[i*RowLen+j];
|
||||
out << QString("%1,%2,%3\n").arg(x).arg(y).arg(z);
|
||||
}
|
||||
}
|
||||
out.flush();// 刷新缓冲区
|
||||
}
|
||||
delete datablock;
|
||||
datablock=nullptr;
|
||||
for(long h = 0; h < rasterdatades.getHeight(); h++) {
|
||||
for(long w = 0; w < rasterdatades.getHeight(); w++) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GDALClose(poDataset); // 关闭波段
|
||||
file.close();
|
||||
return true;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
bool DEM2PointCloud_Geo(RasterToolBase::RasterDataClass rasterdatades,QString out_plygon){
|
||||
qDebug()<<"bool DEM2PointCloud_Geo(RasterToolBase::RasterDataClass rasterdatades,QString out_plygon)";
|
||||
if(rasterdatades.getEpsgCode()==-1){return false;}else{}
|
||||
|
||||
QString _inDEMPath=rasterdatades.getFilepath();
|
||||
|
||||
// 创建文件对象
|
||||
QFile file(out_plygon);
|
||||
|
||||
// 打开文件,如果打开失败则输出错误信息并返回
|
||||
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
||||
qDebug() << "Could not open file for writing.";
|
||||
return 1;
|
||||
}
|
||||
QTextStream out(&file);
|
||||
|
||||
GDALAllRegister();
|
||||
CPLSetConfigOption("GDAL_FILENAME_IS_UTF8", "YES"); // 注册GDAL驱动
|
||||
|
||||
// 定义输入的空间参考系统(WGS84坐标系)
|
||||
OGRSpatialReference oSRS;
|
||||
oSRS.importFromEPSG(rasterdatades.getEpsgCode()); // EPSG:4326 是WGS84坐标系的标识
|
||||
|
||||
// 定义输出的空间参考系统(地心地固坐标系,通常是ECEF)
|
||||
OGRSpatialReference oTargetSRS;
|
||||
oTargetSRS.SetWellKnownGeogCS("WGS84"); // 使用WGS84的地心参考系
|
||||
OGRCoordinateTransformation *poTransform = OGRCreateCoordinateTransformation(&oSRS, &oTargetSRS);
|
||||
if (poTransform == nullptr) {
|
||||
qDebug("Transformation initialization failed.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
GDALDataset *poDataset;
|
||||
poDataset = (GDALDataset *)GDALOpen(_inDEMPath.toUtf8().data(), GA_ReadOnly);
|
||||
{
|
||||
if(NULL == poDataset) {
|
||||
return false;
|
||||
}
|
||||
GDALRasterBand *poBand = poDataset->GetRasterBand(1);
|
||||
|
||||
// 仿射矩阵
|
||||
double gt[6];
|
||||
poDataset->GetGeoTransform(gt);
|
||||
|
||||
// 分块处理
|
||||
long block_row_len=5000;
|
||||
long block_col_len=5000;
|
||||
RasterToolBase::RasterDataSplitBlockParams blockParams(rasterdatades.getHeight(),rasterdatades.getWidth(),5000,5000);
|
||||
|
||||
long start_row=0;
|
||||
long start_col=0;
|
||||
long RowLen=0;
|
||||
long ColLen=0;
|
||||
T* datablock=new T[block_row_len*block_col_len];
|
||||
double lon,lat,ati,x,y,z;
|
||||
OGRPoint pt; // 经纬度坐标
|
||||
|
||||
for(long id=0;id<blockParams.getBlockCount();id++){
|
||||
blockParams.getBlockParams(start_row,start_col,RowLen,ColLen,id);
|
||||
if(RowLen!=block_row_len||ColLen!=block_col_len){
|
||||
delete datablock; // 释放之后重新释放
|
||||
datablock=new T[block_row_len*block_col_len];
|
||||
poBand->RasterIO(GF_Read, start_col, start_row, ColLen, RowLen, datablock, ColLen, RowLen, rasterdatades.getDataType(), 0, 0);
|
||||
}else{
|
||||
poBand->RasterIO(GF_Read, start_col, start_row, ColLen, RowLen, datablock, ColLen, RowLen, rasterdatades.getDataType(), 0, 0);
|
||||
}
|
||||
// 计算坐标,并输出
|
||||
for(long i=0;i<RowLen;i++){
|
||||
for(long j=0;j<ColLen;j++){
|
||||
lon = gt[0] + gt[1] * (j+start_col) + gt[2] * (i+start_row);
|
||||
lat = gt[3] + gt[4] * (j+start_col) + gt[5] * (i+start_row);
|
||||
ati=datablock[i*RowLen+j];
|
||||
pt.setX(lon);
|
||||
pt.setY(lat);
|
||||
pt.setZ(ati);
|
||||
|
||||
if (pt.transform(poTransform) != OGRERR_NONE) {
|
||||
qDebug("Transformation failed.\n");
|
||||
break;
|
||||
}
|
||||
x = pt.getX();
|
||||
y = pt.getY();
|
||||
z = pt.getZ();
|
||||
out << QString("%1,%2,%3\n").arg(x).arg(y).arg(z);
|
||||
}
|
||||
}
|
||||
out.flush();// 刷新缓冲区
|
||||
}
|
||||
delete datablock;
|
||||
datablock=nullptr;
|
||||
for(long h = 0; h < rasterdatades.getHeight(); h++) {
|
||||
for(long w = 0; w < rasterdatades.getHeight(); w++) {
|
||||
}
|
||||
}
|
||||
}
|
||||
OGRCoordinateTransformation::DestroyCT(poTransform);
|
||||
GDALClose(poDataset); // 关闭波段
|
||||
file.close();
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // LAMPCAE_DEM2POINTCLOUDTEMPLATEFUN_H
|
|
@ -101,9 +101,9 @@ add_library(PluginWBFZExchangePlugin
|
|||
${_header}
|
||||
${_source}
|
||||
${SOURCES}
|
||||
dialogimportmodeldataset.cpp
|
||||
dialogimportmodeldataset.h
|
||||
dialogimportmodeldataset.ui
|
||||
../PluginMeshDataExchange/dialogimportmodeldataset.cpp
|
||||
../PluginMeshDataExchange/dialogimportmodeldataset.h
|
||||
../PluginMeshDataExchange/dialogimportmodeldataset.ui
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -1429,6 +1429,7 @@ bool FEKOBase::FBPImage_FREQ(QString& restiffpath, Eigen::MatrixXcd& echoData,
|
|||
Eigen::MatrixXd& X, Eigen::MatrixXd& Y, Eigen::MatrixXd& Z,
|
||||
ImageAlgWindowFun winfun, FEKOBase::FEKORESULTFIELDTYPE EchoMode)
|
||||
{
|
||||
qDebug()<<"bool FEKOBase::FBPImage_FREQ";
|
||||
// BP成像算法
|
||||
const double c = 0.299792458; // 光速
|
||||
const std::complex<double> j(0, 1); // 虚数单位
|
||||
|
@ -1460,11 +1461,14 @@ bool FEKOBase::FBPImage_FREQ(QString& restiffpath, Eigen::MatrixXcd& echoData,
|
|||
|
||||
{ // 适用于近场成像 ,只有 ISAR 与 圆迹SAR 适用于远场
|
||||
#ifdef __IMAGEPARALLEL
|
||||
#pragma omp parallel for
|
||||
for(long ii = 0; ii < image_height; ii++) {
|
||||
unsigned int cores = std::thread::hardware_concurrency()/2+1; // CPU 核数
|
||||
size_t block_len=image_height/cores+1; // 获取模块计算
|
||||
#pragma omp parallel for num_threads(cores)
|
||||
for(long start_ii = 0; start_ii < image_height; start_ii=start_ii+block_len) {
|
||||
Eigen::MatrixXd im_R = Eigen::MatrixXd::Zero(PRFCount, 1); // 图像到脉冲矩阵 prf*1
|
||||
Eigen::MatrixXcd term_R = Eigen::MatrixXcd::Zero(1, frepoints);
|
||||
Eigen::MatrixXcd pluse_R = Eigen::MatrixXcd::Zero(PRFCount, 1);
|
||||
for(long ii=start_ii;ii<start_ii+block_len &&ii<image_height ;ii++)
|
||||
#else
|
||||
Eigen::MatrixXd im_R = Eigen::MatrixXd::Zero(PRFCount, 1); // 图像到脉冲矩阵 prf*1
|
||||
Eigen::MatrixXcd term_R = Eigen::MatrixXcd::Zero(1, frepoints);
|
||||
|
@ -1480,6 +1484,7 @@ bool FEKOBase::FBPImage_FREQ(QString& restiffpath, Eigen::MatrixXcd& echoData,
|
|||
.array(); // 获取目标到天线矩阵 计算
|
||||
|
||||
// im_R PRF_count x 1
|
||||
|
||||
for(size_t tt = 0; tt < PRFCount; tt++) {
|
||||
term_R = (im_R(tt, 0) * factorj.array()).array().exp(); // ok
|
||||
#ifdef __PRFPLUSECORRECT_R_
|
||||
|
@ -1828,6 +1833,7 @@ bool FEKOBase::FBPImage_CirCleSAR(QString& restiffpath, MatrixXcd& echoData, Mat
|
|||
FEKOBase::ImageAlgWindowFun winfun,
|
||||
FEKOBase::FEKORESULTFIELDTYPE EchoMode)
|
||||
{
|
||||
qDebug()<<"bool FEKOBase::FBPImage_CirCleSAR";
|
||||
// BP成像算法
|
||||
const double c = 0.299792458; // 光速
|
||||
const std::complex<double> j(0, 1); // 虚数单位
|
||||
|
@ -1855,8 +1861,8 @@ bool FEKOBase::FBPImage_CirCleSAR(QString& restiffpath, MatrixXcd& echoData, Mat
|
|||
progressDialog.show();
|
||||
#endif // __SHOWPROCESS
|
||||
|
||||
#ifdef __IMAGEWINDOWSPROCESS // 加窗处理
|
||||
Eigen::MatrixXd normw = WINDOWFun(echoData, winfun);
|
||||
#ifdef __IMAGEWINDOWSPROCESS // 加窗处理
|
||||
//Eigen::MatrixXd normw = WINDOWFun(echoData, winfun);
|
||||
#endif
|
||||
|
||||
if(EchoMode == FEKOBase::FARFIELD) { // 远场模式只有 ISAR 与 圆迹成像模式启动
|
||||
|
@ -1875,11 +1881,14 @@ bool FEKOBase::FBPImage_CirCleSAR(QString& restiffpath, MatrixXcd& echoData, Mat
|
|||
(Mat_Freq.array().cast<std::complex<double>>().array() * j * 4 * M_PI / c).exp().array()
|
||||
* (echoData.array());
|
||||
#ifdef __IMAGEPARALLEL
|
||||
#pragma omp parallel for
|
||||
for(long ii = 0; ii < image_height; ii++) {
|
||||
unsigned int cores = std::thread::hardware_concurrency()/2+1; // CPU 核数
|
||||
size_t block_len=image_height/cores+1; // 获取模块计算
|
||||
#pragma omp parallel for num_threads(cores)
|
||||
for(long start_ii = 0; start_ii < image_height; start_ii=start_ii+block_len) {
|
||||
Eigen::MatrixXd im_R = Eigen::MatrixXd::Zero(PRFCount, 1); // 图像到脉冲矩阵 prf*1
|
||||
Eigen::MatrixXcd term_R = Eigen::MatrixXcd::Zero(1, frepoints);
|
||||
Eigen::MatrixXcd pluse_R = Eigen::MatrixXcd::Zero(PRFCount, 1);
|
||||
for(long ii=start_ii;ii<start_ii+block_len &&ii<image_height ;ii++)
|
||||
#else
|
||||
Eigen::MatrixXd im_R = Eigen::MatrixXd::Zero(PRFCount, 1); // 图像到脉冲矩阵 prf*1
|
||||
Eigen::MatrixXcd term_R = Eigen::MatrixXcd::Zero(1, frepoints);
|
||||
|
@ -1911,7 +1920,7 @@ bool FEKOBase::FBPImage_CirCleSAR(QString& restiffpath, MatrixXcd& echoData, Mat
|
|||
}
|
||||
|
||||
#ifdef __IMAGEWINDOWSPROCESS // 加窗处理
|
||||
im_final = im_final.array() / (normw.array().sum());
|
||||
// im_final = im_final.array() / (normw.array().sum());
|
||||
#endif
|
||||
|
||||
}
|
||||
|
@ -1954,7 +1963,7 @@ bool FEKOBase::FBPImage_CirCleSAR(QString& restiffpath, MatrixXcd& echoData, Mat
|
|||
}
|
||||
|
||||
#ifdef __IMAGEWINDOWSPROCESS // 加窗处理
|
||||
im_final = im_final.array() / (normw.array().sum());
|
||||
//im_final = im_final.array() / (normw.array().sum());
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -2005,6 +2014,7 @@ bool FEKOBase::FBPImage_ISARNEAR(QString& restiffpath, MatrixXcd& echoData, Matr
|
|||
FEKOBase::ImageAlgWindowFun winfun,
|
||||
FEKOBase::FEKORESULTFIELDTYPE EchoMode)
|
||||
{
|
||||
qDebug()<<"bool FEKOBase::FBPImage_ISARNEAR";
|
||||
// BP成像算法
|
||||
const double c = 0.299792458; // 光速
|
||||
const std::complex<double> j(0, 1); // 虚数单位
|
||||
|
@ -2094,11 +2104,14 @@ bool FEKOBase::FBPImage_ISARNEAR(QString& restiffpath, MatrixXcd& echoData, Matr
|
|||
}
|
||||
else { // 适用于近场成像
|
||||
#ifdef __IMAGEPARALLEL
|
||||
#pragma omp parallel for
|
||||
for(long ii = 0; ii < image_height; ii++) {
|
||||
unsigned int cores = std::thread::hardware_concurrency()/2+1; // CPU 核数
|
||||
size_t block_len=image_height/cores+1; // 获取模块计算
|
||||
#pragma omp parallel for num_threads(cores)
|
||||
for(long start_ii = 0; start_ii < image_height; start_ii=start_ii+block_len) {
|
||||
Eigen::MatrixXd im_R = Eigen::MatrixXd::Zero(PRFCount, 1); // 图像到脉冲矩阵 prf*1
|
||||
Eigen::MatrixXcd term_R = Eigen::MatrixXcd::Zero(1, frepoints);
|
||||
Eigen::MatrixXcd pluse_R = Eigen::MatrixXcd::Zero(PRFCount, 1);
|
||||
for(long ii=start_ii;ii<start_ii+block_len &&ii<image_height ;ii++)
|
||||
#else
|
||||
|
||||
Eigen::MatrixXd im_R = Eigen::MatrixXd::Zero(PRFCount, 1); // 图像到脉冲矩阵 prf*1
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -137,7 +137,7 @@ public: // 方法
|
|||
void saveImage(Eigen::MatrixXcd data, int start_row, int start_col, int band_ids);
|
||||
Eigen::MatrixXcd getDataComplex(int start_row, int start_col, int rows_count, int cols_count, int band_ids);
|
||||
void saveImage() override;
|
||||
|
||||
void savePreViewImage();
|
||||
public:
|
||||
Eigen::MatrixXcd data;
|
||||
};
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<widget class="QListWidget" name="listWidgetContent">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>16</pointsize>
|
||||
<pointsize>14</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<item>
|
||||
|
@ -27,6 +27,11 @@
|
|||
<string>fsada</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>范德萨</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
|
|
@ -100,6 +100,42 @@ void LAMPImageCreateClass::on_pushButton_OK_clicked()
|
|||
{
|
||||
|
||||
FEKOBase::FEKOImageSettingParams imageparams = this->getFEKOImageSettingParams();
|
||||
// 成像前检查
|
||||
{
|
||||
// 检查成像模式
|
||||
qDebug()<<QString("Current image mode : %1 ").arg(this->ui->comboBox_ImageMode->currentText().trimmed());
|
||||
FEKOBase::FEKOImageMode imgmode=FEKOBase::FEKOImageModeString2Enum(this->ui->comboBox_ImageMode->currentText().trimmed());
|
||||
this->simulationparams->imagemode=imgmode;
|
||||
switch(imgmode){
|
||||
case(FEKOBase::FEKOImageMode::Strip):{
|
||||
break;
|
||||
}
|
||||
case(FEKOBase::FEKOImageMode::Scane):{
|
||||
break;
|
||||
}
|
||||
case(FEKOBase::FEKOImageMode::ISAR):{
|
||||
break;
|
||||
}
|
||||
case(FEKOBase::FEKOImageMode::CircleSAR):{
|
||||
break;
|
||||
}
|
||||
default:{
|
||||
QMessageBox::warning(this,"waring","the image mode do not found");
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(QFile(this->ui->lineEdit_thetaechopath->text().trimmed()).exists()){}else{
|
||||
QMessageBox::warning(this,"waring","the theta ehco data file do not found");
|
||||
}
|
||||
|
||||
if(QFile(this->ui->lineEdit_phiechopath->text().trimmed()).exists()){}else{
|
||||
QMessageBox::warning(this,"waring","the phi ehco data file do not found");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 计算回波
|
||||
if (this->ui->checkBoxTheta->isChecked()) { // theta
|
||||
|
||||
|
@ -110,11 +146,11 @@ void LAMPImageCreateClass::on_pushButton_OK_clicked()
|
|||
qDebug()<<"theta EchoData loading start !!! EchoData File : "<<thetafileptah;
|
||||
data.loadEchoData(thetafileptah);
|
||||
qDebug()<<"theta EchoData loading finish !!! EchoData File : "<<thetafileptah;
|
||||
if (this->simulationparams&&(this->simulationparams->imagemode==FEKOBase::FEKOImageMode::Strip|| this->simulationparams->imagemode == FEKOBase::FEKOImageMode::Scane)) {
|
||||
if ( (this->simulationparams->imagemode==FEKOBase::FEKOImageMode::Strip|| this->simulationparams->imagemode == FEKOBase::FEKOImageMode::Scane)) {
|
||||
FEKOBase::FEKOImageProcess(data, imageparams, theta_tiff_filepath,FEKOBase::FEKOImageAlgorithm::TBP_FREQ,FEKOBase::ImageAlgWindowFun::HANMMING);
|
||||
}
|
||||
else {
|
||||
FEKOBase::FEKOImageProcess(data, imageparams, theta_tiff_filepath,FEKOBase::FEKOImageAlgorithm::TBP_FREQ);
|
||||
FEKOBase::FEKOImageProcess(data, imageparams, theta_tiff_filepath,FEKOBase::FEKOImageAlgorithm::TBP_CIRCLESAR,FEKOBase::ImageAlgWindowFun::UNKONWWINDOW);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -131,18 +167,25 @@ void LAMPImageCreateClass::on_pushButton_OK_clicked()
|
|||
data.loadEchoData(phifileptah);
|
||||
qDebug()<<"phi EchoData loading finish !!! EchoData File : "<<phifileptah;
|
||||
//FEKOBase::FEKOImageProcess(data, imageparams, phi_tiff_filepath);
|
||||
if (this->simulationparams && (this->simulationparams->imagemode == FEKOBase::FEKOImageMode::Strip || this->simulationparams->imagemode == FEKOBase::FEKOImageMode::Scane)) {
|
||||
FEKOBase::FEKOImageProcess(data, imageparams, phi_tiff_filepath, FEKOBase::FEKOImageAlgorithm::TBP_FREQ, FEKOBase::ImageAlgWindowFun::HANMMING);
|
||||
}
|
||||
else if(this->simulationparams->imagemode == FEKOBase::FEKOImageMode::ISAR){
|
||||
FEKOBase::FEKOImageProcess(data, imageparams, phi_tiff_filepath,FEKOBase::FEKOImageAlgorithm::FAR_ISAR);
|
||||
}else if(this->simulationparams->imagemode == FEKOBase::FEKOImageMode::CircleSAR){
|
||||
FEKOBase::FEKOImageProcess(data, imageparams, phi_tiff_filepath,FEKOBase::FEKOImageAlgorithm::TBP_CIRCLESAR,FEKOBase::ImageAlgWindowFun::HANMMING1AXIS);
|
||||
|
||||
if ( (this->simulationparams->imagemode==FEKOBase::FEKOImageMode::Strip|| this->simulationparams->imagemode == FEKOBase::FEKOImageMode::Scane)) {
|
||||
FEKOBase::FEKOImageProcess(data, imageparams, phi_tiff_filepath,FEKOBase::FEKOImageAlgorithm::TBP_FREQ,FEKOBase::ImageAlgWindowFun::HANMMING);
|
||||
}
|
||||
else {
|
||||
FEKOBase::FEKOImageProcess(data, imageparams, phi_tiff_filepath,FEKOBase::FEKOImageAlgorithm::TBP_FREQ);
|
||||
FEKOBase::FEKOImageProcess(data, imageparams, phi_tiff_filepath,FEKOBase::FEKOImageAlgorithm::TBP_CIRCLESAR,FEKOBase::ImageAlgWindowFun::UNKONWWINDOW);
|
||||
}
|
||||
|
||||
// if ( (this->simulationparams->imagemode == FEKOBase::FEKOImageMode::Strip || this->simulationparams->imagemode == FEKOBase::FEKOImageMode::Scane)) {
|
||||
// FEKOBase::FEKOImageProcess(data, imageparams, phi_tiff_filepath, FEKOBase::FEKOImageAlgorithm::TBP_FREQ, FEKOBase::ImageAlgWindowFun::HANMMING);
|
||||
// }
|
||||
// else if(this->simulationparams->imagemode == FEKOBase::FEKOImageMode::ISAR){
|
||||
// FEKOBase::FEKOImageProcess(data, imageparams, phi_tiff_filepath,FEKOBase::FEKOImageAlgorithm::FAR_ISAR);
|
||||
// }else if(this->simulationparams->imagemode == FEKOBase::FEKOImageMode::CircleSAR){
|
||||
// FEKOBase::FEKOImageProcess(data, imageparams, phi_tiff_filepath,FEKOBase::FEKOImageAlgorithm::TBP_CIRCLESAR,FEKOBase::ImageAlgWindowFun::UNKONWWINDOW);
|
||||
// }
|
||||
// else {
|
||||
// FEKOBase::FEKOImageProcess(data, imageparams, phi_tiff_filepath,FEKOBase::FEKOImageAlgorithm::TBP_FREQ);
|
||||
// }
|
||||
}
|
||||
else {
|
||||
|
||||
|
|
Loading…
Reference in New Issue