From 922a98082e03c601800ceb474a43992fa99f608d Mon Sep 17 00:00:00 2001 From: c-weidinger Date: Fri, 19 Jan 2018 15:26:53 +0100 Subject: [PATCH] First Working Version with Result Image --- Source/functions/solve/puzzleExtension.cpp | 24 ++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/Source/functions/solve/puzzleExtension.cpp b/Source/functions/solve/puzzleExtension.cpp index cf38fcf..d3604fa 100644 --- a/Source/functions/solve/puzzleExtension.cpp +++ b/Source/functions/solve/puzzleExtension.cpp @@ -128,7 +128,7 @@ Mat Puzzle::readImage(int fileIndex, const char* inputDir){ } Mat Puzzle::resultImage( vector& log){ - int Y_size = 600; // chose this to fit your monitor! + int Y_size = 1200; // chose this to fit your monitor! int separator = 1; int partHeight = 90; int partWidth; @@ -141,6 +141,10 @@ Mat Puzzle::resultImage( vector& log){ partWidth= partHeight; int imageW = int(round( partWidth*rows)); + int temp = imageW; + imageW = imageH; + imageH = temp; + cout<<"imageW "<& log){ char name[100]; for (auto it:log) { + if (it.myCoor.col == 12 && it.myCoor.row == 0) + { + ; + // imshow("result",result); + // waitKey(0); + } cout << log.size() << endl; cout << log[0].PieceCollector.size() << endl; @@ -159,7 +169,14 @@ Mat Puzzle::resultImage( vector& log){ sprintf(name, PATH, imageNumber); Mat img = imread(name, 1); - int angle = it.PieceCollector[0].second->GetNumOfRotations()*90; + if (it.myCoor.col == 12 && it.myCoor.row == 0) + { + //imshow("img",img); + //waitKey(0); + ; + } + + int angle = ((int)it.PieceCollector[0].second->GetNumOfRotations())*-90; Point2f center; center.x = img.cols/2; center.y = img.rows/2; @@ -180,6 +197,9 @@ Mat Puzzle::resultImage( vector& log){ // imshow("result",result); // waitKey(0); + } + imshow("result",result); + waitKey(0); return result; }