From a3e2b2a10b6b24a9680d7b829172e71647acdd96 Mon Sep 17 00:00:00 2001 From: Raphael Maenle <17550607+g-spacewhale@users.noreply.github.com> Date: Thu, 18 Jan 2018 22:14:45 +0100 Subject: [PATCH] manual debugger action program seems to break debugger. not sure why. --- Source/functions/solve/puzzleExtension.cpp | 52 +++++++++++----------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/Source/functions/solve/puzzleExtension.cpp b/Source/functions/solve/puzzleExtension.cpp index cf38fcf..5fb8514 100644 --- a/Source/functions/solve/puzzleExtension.cpp +++ b/Source/functions/solve/puzzleExtension.cpp @@ -1,7 +1,6 @@ // // Created by Raphael Maenle on 21/12/2017. // - #include "../../header/solve.h" #include "../../header/input.h" @@ -41,7 +40,7 @@ void Puzzle::putIntoBox() for(int rotations=0;rotations<4;rotations++) { tmpPart.m_a1.shift(1); - //TODO! add all other layerswith their rotaionvariance here + //TODO! add all other layers with their rotaionvariance here myBox.emplace_back(tmpPart); } @@ -148,36 +147,39 @@ Mat Puzzle::resultImage( vector& log){ char name[100]; for (auto it:log) { - cout << log.size() << endl; - cout << log[0].PieceCollector.size() << endl; - cout << it.PieceCollector[0].second->GetPartID() << endl; + cout << "row: " << it.myCoor.row << ", col: " << it.myCoor.col << endl; + cout << "ID:" << it.PieceCollector[0].second->GetPartID() << endl; + int imageNumber = it.PieceCollector[0].second->GetPartID(); + //cout<<"imageIndex: "<< imageNumber << endl; - int imageNumber = it.PieceCollector[0].second->GetPartID(); - //cout<<"imageIndex: "<< imageNumber << endl; - - sprintf(name, PATH, imageNumber); - Mat img = imread(name, 1); - - int angle = it.PieceCollector[0].second->GetNumOfRotations()*90; - Point2f center; - center.x = img.cols/2; - center.y = img.rows/2; - Mat RotMatrix = getRotationMatrix2D(center,angle,1); - warpAffine(img,img,RotMatrix, img.size()); -// imshow("readImg",img); // you can comment with Ctrl + / did you know? :D + sprintf(name, PATH, imageNumber); + Mat img = imread(name, 1); + cout << "loc: " << name << endl; + cout << "img size: " << img.size() << endl; + int angle = it.PieceCollector[0].second->GetNumOfRotations()*90; + Point2f center; + center.x = img.cols/2; + center.y = img.rows/2; + Mat RotMatrix = getRotationMatrix2D(center,angle,1); + warpAffine(img,img,RotMatrix, img.size()); + cout << "warped" << endl; +// imshow("readImg",img); // you can comment with Ctrl + / did you know? :D nop, but that's useful, tx // waitKey(0); - auto ROI_X = int(round(it.myCoor.col*partWidth)); - auto ROI_Y = int(round(it.myCoor.row*partHeight)); + auto ROI_X = int(round(it.myCoor.col*partWidth)); + auto ROI_Y = int(round(it.myCoor.row*partHeight)); // cout<<"ROI X: "<< ROI_X<