检查成像问题

pull/3/head
陈增辉 2024-12-28 15:25:56 +08:00
parent a7d2ed7996
commit dce9400f1c
3 changed files with 14 additions and 13 deletions

View File

@ -16,7 +16,7 @@
//#define __PRFDEBUG__ //#define __PRFDEBUG__
#define __TBPIMAGE__
//#include <mkl.h> //#include <mkl.h>
#include <complex> #include <complex>

View File

@ -37,7 +37,8 @@ __global__ void CUDA_TBPImage(
float factorj = freq * 4 * PI / LIGHTSPEED; float factorj = freq * 4 * PI / LIGHTSPEED;
cuComplex Rfactorj = make_cuComplex(0, factorj * R); cuComplex Rfactorj = make_cuComplex(0, factorj * R);
cuComplex Rphi =cuCexpf(Rfactorj);// 校正项 cuComplex Rphi =cuCexpf(Rfactorj);// 校正项
imgArr[idx] = cuCaddf(imgArr[idx], cuCmulf(echoArr[Rid] , Rphi));// ½ÃÕý cuComplex echotime = echoArr[prfid * freqcount + Rid];
imgArr[idx] = cuCaddf(imgArr[idx], cuCmulf(echotime, Rphi));// ½ÃÕý
//printf("R=%f;Rid=%d;factorj=%f;Rfactorj=complex(%f,%f);Rphi=complex(%f,%f);\n", R, Rid, factorj, //printf("R=%f;Rid=%d;factorj=%f;Rfactorj=complex(%f,%f);Rphi=complex(%f,%f);\n", R, Rid, factorj,
// Rfactorj.x, Rfactorj.y, // Rfactorj.x, Rfactorj.y,
// Rphi.x, Rphi.y); // Rphi.x, Rphi.y);
@ -60,13 +61,13 @@ extern "C" void CUDATBPImage(float* antPx, float* antPy, float* antPz,
// 调用 CUDA 核函数 CUDA_RTPC_Kernel // 调用 CUDA 核函数 CUDA_RTPC_Kernel
CUDA_TBPImage << <numBlocks, blockSize >> > ( CUDA_TBPImage << <numBlocks, blockSize >> > (
antPx, antPy, antPz, antPx, antPy, antPz,
imgx, imgy, imgz, imgx, imgy, imgz,
R, R,
echoArr, imgArr, echoArr, imgArr,
freq, fs, Rnear, Rfar, freq, fs, Rnear, Rfar,
rowcount, colcount, rowcount, colcount,
prfid, freqcount prfid, freqcount
); );

View File

@ -280,8 +280,6 @@ ErrorCode TBPImageAlgCls::ProcessGPU()
tempimgBlockline, colCount, tempimgBlockline, colCount,
tempechoBlockline, PlusePoints ); tempechoBlockline, PlusePoints );
} }
this->L1ds->saveImageRaster(imgArr, startimgrowid, tempimgBlockline); this->L1ds->saveImageRaster(imgArr, startimgrowid, tempimgBlockline);
} }
@ -393,12 +391,14 @@ void TBPImageGPUAlg(std::shared_ptr<float> antPx, std::shared_ptr<float> antPy,
// Device -> Host // Device -> Host
DeviceToHost(h_imgArr, d_imgArr, sizeof(cuComplex) * rowcount * colcount); DeviceToHost(h_imgArr, d_imgArr, sizeof(cuComplex) * rowcount * colcount);
DeviceToHost(h_R,d_R,sizeof(float)*rowcount*colcount);
for (long i = 0; i < rowcount; i++) { for (long i = 0; i < rowcount; i++) {
for (long j = 0; j < colcount; j++) { for (long j = 0; j < colcount; j++) {
imgArr.get()[i * colcount + j] = imgArr.get()[i * colcount + j]+ std::complex<float>(h_imgArr[i * colcount + j].x, imgArr.get()[i * colcount + j] = std::complex<float>(h_imgArr[i * colcount + j].x,h_imgArr[i * colcount + j].y);
h_imgArr[i * colcount + j].y);
} }
} }