修改采样工具
parent
0a1497ac5e
commit
e3bcfe3e98
|
@ -906,6 +906,88 @@ int ResampleEChoDataFromGeoEcho(QString L2echodataPath, QString RangeLooktablePa
|
|||
|
||||
}
|
||||
|
||||
int ResampleRangeDataFromGeoImage(QString geodataPath, QString RangeLooktablePath, QString RangeDataPath)
|
||||
{
|
||||
gdalImage echodata(geodataPath);
|
||||
gdalImage looktable(RangeLooktablePath);
|
||||
gdalImage l1adata(RangeDataPath);
|
||||
Eigen::MatrixXd echoArr = echodata.getData(0, 0, echodata.height, echodata.width, 1);
|
||||
|
||||
long blockHeight = Memory1GB / looktable.width / 8 * 2;
|
||||
|
||||
for (long startRow = 0; startRow < looktable.height; startRow = startRow + blockHeight) {
|
||||
printf("\rGEC: process:%f precent\t\t\t", startRow * 100.0 / looktable.height);
|
||||
blockHeight = blockHeight + startRow < looktable.height ? blockHeight : looktable.height - startRow;
|
||||
Eigen::MatrixXd imglonArr = looktable.getData(startRow, 0, blockHeight, looktable.width, 1);
|
||||
Eigen::MatrixXd imglatArr = looktable.getData(startRow, 0, blockHeight, looktable.width, 2);
|
||||
Eigen::MatrixXd l1aArr = l1adata.getData(0, 0, blockHeight, l1adata.width, 1);
|
||||
l1aArr = l1aArr.array() * 0;
|
||||
|
||||
long imgheight = blockHeight;
|
||||
long imgwidth = looktable.width;
|
||||
#pragma omp parallel for
|
||||
for (long i = 0; i < imgheight; i++) {
|
||||
|
||||
for (long j = 0; j < imgwidth; j++) {
|
||||
double lon = imglonArr(i, j);
|
||||
double lat = imglatArr(i, j);
|
||||
Landpoint point = echodata.getRow_Col(lon, lat);
|
||||
|
||||
if (point.lon<1 || point.lon>echodata.width - 2 || point.lat < 1 || point.lat >echodata.height - 2) {
|
||||
continue;
|
||||
}
|
||||
else {}
|
||||
{
|
||||
Landpoint p0, p11, p21, p12, p22;
|
||||
|
||||
p0.lon = point.lon;
|
||||
p0.lat = point.lat;
|
||||
|
||||
p11.lon = floor(p0.lon);
|
||||
p11.lat = floor(p0.lat);
|
||||
p11.ati = echoArr(long(p11.lat), long(p11.lon));
|
||||
|
||||
p12.lon = ceil(p0.lon);
|
||||
p12.lat = floor(p0.lat);
|
||||
p12.ati = echoArr(long(p12.lat), long(p12.lon));
|
||||
|
||||
p21.lon = floor(p0.lon);
|
||||
p21.lat = ceil(p0.lat);
|
||||
p21.ati = echoArr(long(p21.lat), long(p21.lon));
|
||||
|
||||
p22.lon = ceil(p0.lon);
|
||||
p22.lat = ceil(p0.lat);
|
||||
p22.ati = echoArr(long(p22.lat), long(p22.lon));
|
||||
|
||||
p0.lon = p0.lon - p11.lon;
|
||||
p0.lat = p0.lat - p11.lat;
|
||||
|
||||
p12.lon = p12.lon - p11.lon;
|
||||
p12.lat = p12.lat - p11.lat;
|
||||
|
||||
p21.lon = p21.lon - p11.lon;
|
||||
p21.lat = p21.lat - p11.lat;
|
||||
|
||||
p22.lon = p22.lon - p11.lon;
|
||||
p22.lat = p22.lat - p11.lat;
|
||||
|
||||
p11.lon = p11.lon - p11.lon;
|
||||
p11.lat = p11.lat - p11.lat;
|
||||
|
||||
p0.ati = Bilinear_interpolation(p0, p11, p21, p12, p22);
|
||||
l1aArr(i, j)=p0.ati;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
l1adata.saveImage(l1aArr, startRow, 0, 1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void InterpLookTableRfromDEM(QString lonlatPath, QString DEMPath, QString outllrpath)
|
||||
{
|
||||
gdalImage LLimg(lonlatPath);
|
||||
|
|
|
@ -15,7 +15,9 @@ void InterploateClipAtiByRefDEM(QString ImageLLPath, QString& ImageDEMPath, QStr
|
|||
void InterploateAtiByRefDEM(QString& ImageLLPath, QString& ImageDEMPath, QString& outImageLLAPath, QString& InEchoGPSDataPath);
|
||||
int ReflectTable_WGS2Range(QString dem_rc_path, QString outOriSimTiffPath, QString ori_sim_count_tiffPath, long OriHeight, long OriWidth);
|
||||
|
||||
int ResampleEChoDataFromGeoEcho(QString L2echodataPath, QString RangeLooktablePath, QString L1AEchoDataPath);
|
||||
int ResampleEChoDataFromGeoEcho(QString L2complexechodataPath, QString RangeLooktablePath, QString L1AEchoDataPath);
|
||||
|
||||
int ResampleRangeDataFromGeoImage(QString geodataPath, QString RangeLooktablePath, QString RangeDataPath);
|
||||
|
||||
|
||||
void InterpLookTableRfromDEM(QString lonlatPath, QString DEMPath, QString outllrpath);
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
#include "BaseTool.h"
|
||||
#include "ImageNetOperator.h"
|
||||
#include <QDebug>
|
||||
#include "FileOperator.h"
|
||||
#include "ImageOperatorBase.h"
|
||||
|
||||
|
||||
QSARSimulationComplexEchoDataDialog::QSARSimulationComplexEchoDataDialog(QWidget *parent)
|
||||
|
@ -33,7 +35,7 @@ void QSARSimulationComplexEchoDataDialog::onpushButtonEchoDataSelect_clicked()
|
|||
{
|
||||
QString fileNames = QFileDialog::getOpenFileName(
|
||||
this, // 父窗口
|
||||
tr(u8"选择L1A回波数据文件"), // 标题
|
||||
tr(u8"选择地距数据文件"), // 标题
|
||||
QString(), // 默认路径
|
||||
tr(ENVI_FILE_FORMAT_FILTER) // 文件过滤器
|
||||
);
|
||||
|
@ -69,7 +71,7 @@ void QSARSimulationComplexEchoDataDialog::onpushButtonL1AEchoDataSelect_clicked(
|
|||
{
|
||||
QString fileNames = QFileDialog::getSaveFileName(
|
||||
this, // 父窗口
|
||||
tr(u8"选择L1A回波数据文件"), // 标题
|
||||
tr(u8"选择斜距数据文件"), // 标题
|
||||
QString(), // 默认路径
|
||||
tr(ENVI_FILE_FORMAT_FILTER) // 文件过滤器
|
||||
);
|
||||
|
@ -89,9 +91,31 @@ void QSARSimulationComplexEchoDataDialog::onbuttonBox_accepted()
|
|||
QString RangelookTablePath = this->ui->lineEditLookTablePath->text().trimmed();
|
||||
QString l1AEchoDataPath = this->ui->lineEditL1AEchoDataPath->text().trimmed();
|
||||
|
||||
if (isExists(echoDataPath) && isExists(RangelookTablePath)) {
|
||||
gdalImage echoData(echoDataPath);
|
||||
gdalImage RangelookTable(RangelookTablePath);
|
||||
if (echoData.getDataType() == GDT_CFloat32
|
||||
||echoData.getDataType()==GDT_CFloat64
|
||||
|| echoData.getDataType() == GDT_CInt16
|
||||
|| echoData.getDataType()==GDT_CInt32
|
||||
) {
|
||||
|
||||
ResampleEChoDataFromGeoEcho(echoDataPath, RangelookTablePath, l1AEchoDataPath);
|
||||
QMessageBox::information(this, tr(u8"提示"), tr(u8"没有选择任何文件。"));
|
||||
CreategdalImageComplex(l1AEchoDataPath, RangelookTable.height, RangelookTable.width,1, RangelookTable.gt, RangelookTable.projection, true, true);
|
||||
|
||||
|
||||
ResampleEChoDataFromGeoEcho(echoDataPath, RangelookTablePath, l1AEchoDataPath);
|
||||
}
|
||||
else {
|
||||
CreategdalImage(l1AEchoDataPath, RangelookTable.height, RangelookTable.width, 1, RangelookTable.gt, RangelookTable.projection, true, true);
|
||||
ResampleRangeDataFromGeoImage(echoDataPath, RangelookTablePath, l1AEchoDataPath);
|
||||
}
|
||||
|
||||
QMessageBox::information(this, tr(u8"提示"), tr(u8"完成"));
|
||||
}
|
||||
else {
|
||||
QMessageBox::information(this, tr(u8"提示"), tr(u8"没有选择任何文件。"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void QSARSimulationComplexEchoDataDialog::onbuttonBox_rejected()
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>成像文件:</string>
|
||||
<string>地距文件:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -98,7 +98,7 @@
|
|||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>L1A回波:</string>
|
||||
<string>斜距文件:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
Loading…
Reference in New Issue