Skip to content

Commit

Permalink
feat(threeFrequencyHeterodynePattern.hpp/.cpp): new feature.
Browse files Browse the repository at this point in the history
1. add three frequencies heterody pattern.
2. add precise test for it.
  • Loading branch information
Practice3DVision committed Apr 16, 2024
1 parent c9dd5c8 commit 517971c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,13 @@ void ThreeFrequencyHeterodynePattern_Impl::computeFloorMap(
const int width = confidence.cols;
floor = Mat::zeros(height, width, CV_16UC1);

std::vector<double> frequencies = { 1.0 / params.nbrOfPeriods, 1.0 / (params.nbrOfPeriods - 6), 1.0 / (params.nbrOfPeriods - 11)};
std::vector<float> frequencies = { 1.f / params.nbrOfPeriods, 1.f / (params.nbrOfPeriods - 6), 1.f / (params.nbrOfPeriods - 11)};

auto frequency12 = frequencies[0] * frequencies[1] / (frequencies[1] - frequencies[0]);
auto frequency23 = frequencies[1] * frequencies[2] / (frequencies[2] - frequencies[1]);
auto frequency123 = frequency23 * frequency12 / (frequency23 - frequency12);
auto ratio2d1 = frequency12 / frequencies[0];
auto ratio123d12 = frequency123 / frequency12;
float frequency12 = frequencies[0] * frequencies[1] / (frequencies[1] - frequencies[0]);
float frequency23 = frequencies[1] * frequencies[2] / (frequencies[2] - frequencies[1]);
float frequency123 = frequency23 * frequency12 / (frequency23 - frequency12);
float ratio2d1 = frequency12 / frequencies[0];
float ratio123d12 = frequency123 / frequency12;

Mat wrap12 = Mat::zeros(height, width, CV_32FC1);
Mat wrap23 = Mat::zeros(height, width, CV_32FC1);
Expand Down
2 changes: 1 addition & 1 deletion test/testThreeFrequencyHeterodynePattern.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ TEST_F(ThreeFrequencyHeterodynePatternSuit, testGenerateUnwrap) {
params.height = 1080;
params.width = 1920;
params.horizontal = false;
params.nbrOfPeriods = 70;
params.nbrOfPeriods = 64;

auto pattern = ThreeFrequencyHeterodynePattern::create(params);

Expand Down

0 comments on commit 517971c

Please sign in to comment.