Skip to content

Commit

Permalink
End to end calibration works
Browse files Browse the repository at this point in the history
  • Loading branch information
mrboni committed Jun 26, 2018
1 parent 7fafdff commit 3269401
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Application/Rulr.sln
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,9 @@ Global
{5C557280-E9E7-4789-83F6-7185A89772BD}.Release|x64.ActiveCfg = Release|x64
{5C557280-E9E7-4789-83F6-7185A89772BD}.Release|x64.Build.0 = Release|x64
{5C78C8F2-6D2D-4B46-9D92-E29015F0E66A}.Debug|x64.ActiveCfg = Release|x64
{5C78C8F2-6D2D-4B46-9D92-E29015F0E66A}.Debug|x64.Build.0 = Release|x64
{5C78C8F2-6D2D-4B46-9D92-E29015F0E66A}.Release|x64.ActiveCfg = Release|x64
{5C78C8F2-6D2D-4B46-9D92-E29015F0E66A}.Release|x64.Build.0 = Release|x64
{C135C231-F751-482D-9E4C-C29473E3DD98}.Debug|x64.ActiveCfg = Release|x64
{C135C231-F751-482D-9E4C-C29473E3DD98}.Debug|x64.Build.0 = Release|x64
{C135C231-F751-482D-9E4C-C29473E3DD98}.Release|x64.ActiveCfg = Release|x64
Expand Down
28 changes: 28 additions & 0 deletions Plugin_BrightnessAssignmentMap/src/ofxRulr/Nodes/BAM/World.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@ namespace ofxRulr {
inspector->add(histogramWidget);

inspector->addButton("Update histogram", updateHistogram);

inspector->addButton("Export all...", [this]() {
try {
auto result = ofSystemLoadDialog("Output path", true);
if (result.bSuccess) {
this->exportAll(result.filePath);
}
}
RULR_CATCH_ALL_TO_ALERT;
})->setHeight(100.0f);
}

//----------
Expand Down Expand Up @@ -82,6 +92,24 @@ namespace ofxRulr {
const ofParameterGroup & World::getParameters() const {
return this->parameters;
}

//----------
void World::exportAll(const string & folderPath) const {
auto bamProjectors = this->getProjectors();
for (auto bamProjector : bamProjectors) {
auto projectorViewNode = bamProjector->getInput<Item::Projector>();
auto pathBase = folderPath + "/" + projectorViewNode->getName();
cout << "Exporting to " << pathBase << endl;

bamProjector->exportPass(ofxRulr::Nodes::BAM::Pass::BrightnessAssignmentMap, pathBase + "-BrightnessAssignmentMap.exr");
bamProjector->exportPass(ofxRulr::Nodes::BAM::Pass::BrightnessAssignmentMap, pathBase + "-BrightnessAssignmentMap.png");
bamProjector->exportPass(ofxRulr::Nodes::BAM::Pass::AvailabilityProjection, pathBase + "-AvailabilityProjection.exr");
bamProjector->exportPass(ofxRulr::Nodes::BAM::Pass::AvailabilityProjection, pathBase + "-AvailabilityProjection.png");
bamProjector->exportPass(ofxRulr::Nodes::BAM::Pass::AccumulateAvailability, pathBase + "-AccumulateAvailability.exr");
bamProjector->exportPass(ofxRulr::Nodes::BAM::Pass::AccumulateAvailability, pathBase + "-AccumulateAvailability.png");
bamProjector->exportPass(ofxRulr::Nodes::BAM::Pass::Color, pathBase + "-Color.png");
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace ofxRulr {
void unregisterProjector(shared_ptr<Projector>);
vector<shared_ptr<Projector>> getProjectors() const;
const ofParameterGroup & getParameters() const;
void exportAll(const string & folderPath) const;
protected:
vector<weak_ptr<Projector>> projectors;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace ofxRulr {
struct : ofParameterGroup {
ofParameter<float> threshold{ "Threshold", 5, 0, 255 };
ofParameter<int> dilations{ "Dilations", 3, 0, 10 };
PARAM_DECLARE("Mask", threshold);
PARAM_DECLARE("Mask", threshold, dilations);
} mask;
PARAM_DECLARE("Discontinuity filtering", mask);
} disocontinuityFiltering;
Expand Down

0 comments on commit 3269401

Please sign in to comment.