Make creatematchfilter same with mat
This commit is contained in:
@@ -3,6 +3,10 @@
|
||||
#include "Function1D.h"
|
||||
#include "Function2D.h"
|
||||
#include "Function3D.h"
|
||||
#include <cstdio>
|
||||
#include <iostream>
|
||||
#include <mkl_vml_defines.h>
|
||||
#include <mkl_vml_functions.h>
|
||||
|
||||
Aurora::Matrix Recon::adaptFrequency(Aurora::Matrix &aCE, double ceSampleFrequency, double requiredFrequency)
|
||||
{
|
||||
@@ -65,16 +69,17 @@ Aurora::Matrix Recon::reviseMatchedFilter(const Aurora::Matrix &aMFTime,
|
||||
Aurora::nantoval(normSTD, 0.0);
|
||||
auto sortSTD = Aurora::sort(normSTD);
|
||||
int t = (int)std::round(0.4 * aMFTime.getDimSize(1)) - 1;
|
||||
t = t <= 0 ? 1.0 : t;
|
||||
t = t < 0 ? 0 : t;
|
||||
auto absFTime = abs(aMFTime);
|
||||
auto maxAbsFTime = max(absFTime);
|
||||
auto maxFlag = maxAbsFTime < (0.1 * max(maxAbsFTime));
|
||||
auto lessFlag = normSTD < sortSTD(0, t).toMatrix();
|
||||
auto flags = (maxFlag+lessFlag)>0;
|
||||
long maxCol, maxRow;
|
||||
max(normSTD, Aurora::Column, maxRow, maxCol);
|
||||
for (int j = 0; j < aMFTime.getDimSize(1); ++j)
|
||||
{
|
||||
if ((bool)(lessFlag.getData()[j]) || (bool)(maxFlag.getData()[j]))
|
||||
if (flags[j]>0)
|
||||
{
|
||||
aMFTime(Aurora::$, j) = aMFTime(Aurora::$, maxCol);
|
||||
}
|
||||
@@ -86,9 +91,10 @@ Aurora::Matrix Recon::reviseMatchedFilter(const Aurora::Matrix &aMFTime,
|
||||
{
|
||||
auto absMatchedFilter = Aurora::abs(matchedFilter);
|
||||
auto highNoiseScore = Aurora::mean(absMatchedFilter) * Aurora::std(absMatchedFilter);
|
||||
auto medianNoise = Aurora::median(highNoiseScore);
|
||||
// auto medianNoise = Aurora::median(highNoiseScore);
|
||||
Aurora::min(Aurora::abs(highNoiseScore - Aurora::median(highNoiseScore)), Aurora::Column, row, minCol);
|
||||
}
|
||||
// minCol=811;
|
||||
auto maxMatchFilter = matchedFilter(Aurora::$, minCol).toMatrix();
|
||||
for (int k = 0; k < matchedFilter.getDimSize(1); ++k)
|
||||
{
|
||||
@@ -111,9 +117,12 @@ Aurora::Matrix Recon::createMatchedFilter(const Aurora::Matrix &aCE,
|
||||
bool measuredCEused, bool findDefects,
|
||||
bool aRemoveOutliersFromCEMeasured, std::string aHardwareVersion)
|
||||
{
|
||||
vmlSetMode(VML_EP);
|
||||
Aurora::Matrix mFTime = Aurora::Matrix::copyFromRawData(aCE.getData(), aCE.getDimSize(0), aCE.getDimSize(1));
|
||||
|
||||
Aurora::Matrix matchedFilter;
|
||||
if (measuredCEused && findDefects){
|
||||
mFTime = real(ifft(fft(mFTime)));
|
||||
matchedFilter = reviseMatchedFilter(mFTime, aRemoveOutliersFromCEMeasured);
|
||||
}
|
||||
else{
|
||||
|
||||
Reference in New Issue
Block a user