From d3d7d53a45bc438dcd167ce3974106268723f453 Mon Sep 17 00:00:00 2001 From: Raphael Maenle <17550607+g-spacewhale@users.noreply.github.com> Date: Sat, 27 Jan 2018 13:54:09 +0100 Subject: [PATCH] added a4 result presentation --- .../AbstractionLayer_SURFFeatures.h | 2 +- Source/functions/solve/puzzleExtension.cpp | 12 +++--------- Source/functions/solve/structure.cpp | 7 +++++-- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/Source/functions/AbstractionLayers/Layer_SURFFeatures/AbstractionLayer_SURFFeatures.h b/Source/functions/AbstractionLayers/Layer_SURFFeatures/AbstractionLayer_SURFFeatures.h index bacda38..5dd0070 100644 --- a/Source/functions/AbstractionLayers/Layer_SURFFeatures/AbstractionLayer_SURFFeatures.h +++ b/Source/functions/AbstractionLayers/Layer_SURFFeatures/AbstractionLayer_SURFFeatures.h @@ -6,7 +6,7 @@ #include "opencv2/imgproc/imgproc.hpp" #ifdef _WIN32 -#define PATH_FULL_PUZZLE "..\\..\\..\\puzzle_img\\puzzle1.jpg" +#define PATH_FULL_PUZZLE "..\\..\\..\\puzzle_img\\puzzle2.jpg" #elif defined __unix__ #define PATH_FULL_PUZZLE "..//..//..//puzzle_img//puzzle1.jpg" #elif defined __APPLE__ diff --git a/Source/functions/solve/puzzleExtension.cpp b/Source/functions/solve/puzzleExtension.cpp index dce895c..1e6012e 100644 --- a/Source/functions/solve/puzzleExtension.cpp +++ b/Source/functions/solve/puzzleExtension.cpp @@ -65,8 +65,8 @@ void Puzzle::shuffle() //deletes all constraints from all abstractionlayers void Puzzle::removeConstrains(coor removeCoordinates) { -// this->a1.RemoveConstraintOnPosition(removeCoordinates); -// this->a3.RemoveConstraintOnPosition(removeCoordinates); + this->a1.RemoveConstraintOnPosition(removeCoordinates); + //this->a3.RemoveConstraintOnPosition(removeCoordinates); this->a4.RemoveConstraintOnPosition(removeCoordinates); //TODO!! Add other layer remove here } @@ -78,7 +78,7 @@ void Puzzle::setConstraints(coor setConstraints, Part* constraintPiece) // this->dp.m_constraintMatrix[setConstraints.col][setConstraints.row].DestructionArray.emplace_back(it); //a1 - //this->a1.SetConstraintOnPosition(setConstraints,constraintPiece->m_a1); + this->a1.SetConstraintOnPosition(setConstraints,constraintPiece->m_a1); //a3 //this->a3.SetConstraintOnPosition(setConstraints,constraintPiece->m_a3); @@ -192,12 +192,6 @@ Mat Puzzle::resultImage( vector& log){ Mat invert = Mat::ones(img.size(), CV_8UC3); // invert for rotation to work correctly bitwise_not ( img, invert ); - if (it.myCoor.col == 35 && it.myCoor.row == 5) - { - //imshow("img",img); - //waitKey(0); - ; - } int angle = ((int)it.PieceCollector[0].second->GetNumOfRotations())*-90; diff --git a/Source/functions/solve/structure.cpp b/Source/functions/solve/structure.cpp index 93860b5..10471c9 100755 --- a/Source/functions/solve/structure.cpp +++ b/Source/functions/solve/structure.cpp @@ -95,8 +95,6 @@ void solve(vector& log,Puzzle& puzzleMat) break; } float worth = capLogElements(log); - cout << " | " << worth << endl; - // calculateTrueDestructionPower(log,puzzleMat, worth); CalculateNewCombinedQuality(log, log.back().PieceCollector, puzzleMat.combinedQualityVector); @@ -120,6 +118,11 @@ void setsolution(vector& log, Puzzle& puzzleMat) cout << "set:" << log.back().myCoor.col << "," << log.back().myCoor.row << endl; //cout << "ID: " << log.back().PieceCollector[0].second->GetPartID() << endl; cout << "Size of Log: " << log.back().PieceCollector.size() << endl; + //if(log.back().myCoor.col==32 && log.back().myCoor.row==16) + //{ +// puzzleMat.resultImage(log); +// waitKey(0); +// } } bool backtrack(vector& log, Puzzle& puzzleMat)