-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(interzonSinusFourGrayscalePattern.hpp/.cpp/...): new pattern met…
…hod. 1. support interzon sinus fourgray scale pattern.(detail see paper @cite) 2. add precise test and perfermance test for pattern.
- Loading branch information
1 parent
677de63
commit a0d0447
Showing
10 changed files
with
543 additions
and
251 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#include <benchmark/benchmark.h> | ||
|
||
#include <slmaster.h> | ||
|
||
using namespace slmaster; | ||
using namespace slmaster::algorithm; | ||
using namespace std; | ||
using namespace cv; | ||
|
||
class InterzoneSinusFourGrayscalePatternSuit : public benchmark::Fixture { | ||
public: | ||
void SetUp(const benchmark::State &) override {} | ||
}; | ||
|
||
BENCHMARK_DEFINE_F(InterzoneSinusFourGrayscalePatternSuit, testGenerate) | ||
(benchmark::State &state) { | ||
auto params = InterzoneSinusFourGrayscalePattern::Params(); | ||
params.shiftTime = 3; | ||
params.height = 1080; | ||
params.width = 1920; | ||
params.horizontal = false; | ||
params.nbrOfPeriods = 16; | ||
|
||
auto pattern = InterzoneSinusFourGrayscalePattern::create(params); | ||
|
||
vector<Mat> imgs; | ||
|
||
for (auto _ : state) { | ||
pattern->generate(imgs); | ||
} | ||
} | ||
|
||
BENCHMARK_DEFINE_F(InterzoneSinusFourGrayscalePatternSuit, testUnwrap) | ||
(benchmark::State &state) { | ||
auto params = InterzoneSinusFourGrayscalePattern::Params(); | ||
params.shiftTime = 3; | ||
params.height = 1080; | ||
params.width = 1920; | ||
params.horizontal = false; | ||
params.nbrOfPeriods = 16; | ||
|
||
auto pattern = InterzoneSinusFourGrayscalePattern::create(params); | ||
|
||
vector<Mat> imgs; | ||
pattern->generate(imgs); | ||
|
||
Mat wrappedPhaseMap, floorMap, confidenceMap, unwrapPhaseMap; | ||
|
||
for (auto _ : state) { | ||
pattern->computePhaseMap(imgs, wrappedPhaseMap); | ||
pattern->computeConfidenceMap(imgs, confidenceMap); | ||
pattern->computeFloorMap(imgs, confidenceMap, floorMap); | ||
pattern->unwrapPhaseMap(wrappedPhaseMap, confidenceMap, floorMap, | ||
unwrapPhaseMap); | ||
} | ||
} | ||
|
||
BENCHMARK_REGISTER_F(InterzoneSinusFourGrayscalePatternSuit, testGenerate)->MeasureProcessCPUTime()->UseRealTime()->Unit(benchmark::TimeUnit::kMillisecond); | ||
BENCHMARK_REGISTER_F(InterzoneSinusFourGrayscalePatternSuit, testUnwrap)->MeasureProcessCPUTime()->UseRealTime()->Unit(benchmark::TimeUnit::kMillisecond); | ||
|
||
BENCHMARK_MAIN(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.