Included the Layer_SURFFeature in code
This commit is contained in:
		@@ -7,7 +7,8 @@ map<int,float> DestructionPower_Properties::SpeedTable =
 | 
			
		||||
        {
 | 
			
		||||
                {0,0.99},
 | 
			
		||||
                {1,0.7},
 | 
			
		||||
                {2,0.7}
 | 
			
		||||
                {2,0.7},
 | 
			
		||||
                {3,0.5}
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
bool DestructionPower::PreProcessing(coor mySize,const vector<Part*>* partArray)
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
#pragma once
 | 
			
		||||
//TODO!! increase Destructioncount
 | 
			
		||||
#define DESTRUCTION_COUNT 2
 | 
			
		||||
#define DESTRUCTION_COUNT 3
 | 
			
		||||
 | 
			
		||||
#include "DestructionPower_Properties.h"
 | 
			
		||||
#include "../AbstraktionLayer_Base.h"
 | 
			
		||||
 
 | 
			
		||||
@@ -0,0 +1,28 @@
 | 
			
		||||
#include "AbstractionLayer_SURFFeatures.h"
 | 
			
		||||
 | 
			
		||||
bool AbstractionLayer_SURFFeatures::PreProcessing(coor mySize, const vector<Part*>* partArray)
 | 
			
		||||
{
 | 
			
		||||
    //TODO: Gesamtbild mit OpenCV einlesen
 | 
			
		||||
    //TODO: Gesamtbild anhand der berechneten Spalten und Zeilen auseinander schneiden (Sind in der puzzleKlasse gespeichert)
 | 
			
		||||
    //TODO: Features der einzelnen Felder des ausgeschnittenen Gesamtbildes in der m_constraintMatrix speichern
 | 
			
		||||
 | 
			
		||||
    //TODO: Alle Bilder mit OpenCV öffnen und deren erkannten Features in SURFFeature_Properties der Part-Klasse speichern
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool AbstractionLayer_SURFFeatures::EvaluateQuality (coor constraintCoordinate, qualityVector& qVector)
 | 
			
		||||
{
 | 
			
		||||
    //TODO: Vergleichen, welche der in qualityVector erhaltenen ähnlich viele Features besitzen, wie an der jeweiligen constraintCoordinate in der m_constraintMatrix gespeichert sind
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool AbstractionLayer_SURFFeatures::SetConstraintOnPosition(const coor constraintCoordinate,const AbstractionLayer_SURFFeatures_Properties constraint)
 | 
			
		||||
{
 | 
			
		||||
    //TODO: Benötigen wir nicht unbedint.
 | 
			
		||||
    //TODO: Hier erhalten wir vom Dispatcher welches Teil an welche Position gesetzt wird und wir könnten hier die Features des Bilds in die m_constraintMatrix speichern
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool AbstractionLayer_SURFFeatures::RemoveConstraintOnPosition(const coor constraintCoordinate)
 | 
			
		||||
{
 | 
			
		||||
    //TODO: Wie auch beim SetConstraint sollte uns das hier nicht wirklich interessieren.
 | 
			
		||||
    //TODO: Außer wir setzen etwas in die Contraintmatrix.
 | 
			
		||||
    //TODO: Dann ruft uns der Dispatcher beim Backtrack hier auf und wir müssten das jeweilige PuzzlePart hier wieder rauslöschen.
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,19 @@
 | 
			
		||||
#ifndef SOURCE_ABSTRACTIONLAYER_SURFFEATURES_H
 | 
			
		||||
#define SOURCE_ABSTRACTIONLAYER_SURFFEATURES_H
 | 
			
		||||
 | 
			
		||||
#include "../AbstraktionLayer_Base.h"
 | 
			
		||||
 | 
			
		||||
using namespace std;
 | 
			
		||||
 | 
			
		||||
class AbstractionLayer_SURFFeatures : public AbstractionLayer_Base<AbstractionLayer_SURFFeatures_Properties>
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
    bool PreProcessing(coor mySize, const vector<Part*>* partArray) ;
 | 
			
		||||
    bool EvaluateQuality (const coor constraintCoordinate, qualityVector& qVector);
 | 
			
		||||
    bool SetConstraintOnPosition(const coor constraintCoordinate,const AbstractionLayer_SURFFeatures_Properties constraint);
 | 
			
		||||
    bool RemoveConstraintOnPosition(const coor constraintCoordinate);
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#endif //SOURCE_ABSTRACTIONLAYER_SURFFEATURES_H
 | 
			
		||||
@@ -0,0 +1,16 @@
 | 
			
		||||
#ifndef SOURCE_ABSTRACTIONLAYER_SURFFEATURES_PROPERTIES_H
 | 
			
		||||
#define SOURCE_ABSTRACTIONLAYER_SURFFEATURES_PROPERTIES_H
 | 
			
		||||
 | 
			
		||||
#include <stdint.h>
 | 
			
		||||
 | 
			
		||||
class AbstractionLayer_SURFFeatures_Properties
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
    AbstractionLayer_SURFFeatures_Properties() {}
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
    uint16_t m_numberOfFeaturesDetected;
 | 
			
		||||
    friend class AbstractionLayer_SURFFeatures;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#endif //SOURCE_ABSTRACTIONLAYER_SURFFEATURES_PROPERTIES_H
 | 
			
		||||
@@ -38,6 +38,7 @@ void Puzzle::putIntoBox()
 | 
			
		||||
 | 
			
		||||
            tmpPart.m_a1=this->a1.m_constraintMatrix[i+1][j+1];
 | 
			
		||||
            tmpPart.m_a3=this->a3.m_constraintMatrix[i][j];
 | 
			
		||||
            tmpPart.m_a4=this->a4.m_constraintMatrix[i][j];
 | 
			
		||||
            //sets part id
 | 
			
		||||
            tmpPart.SetPartID(id++);
 | 
			
		||||
            // adds all 4 rotations to Box
 | 
			
		||||
@@ -66,6 +67,7 @@ void Puzzle::removeConstrains(coor removeCoordinates)
 | 
			
		||||
{
 | 
			
		||||
    this->a1.RemoveConstraintOnPosition(removeCoordinates);
 | 
			
		||||
    this->a3.RemoveConstraintOnPosition(removeCoordinates);
 | 
			
		||||
    this->a4.RemoveConstraintOnPosition(removeCoordinates);
 | 
			
		||||
    //TODO!! Add other layer remove here
 | 
			
		||||
}
 | 
			
		||||
void Puzzle::setConstraints(coor setConstraints, Part* constraintPiece)
 | 
			
		||||
@@ -80,6 +82,9 @@ void Puzzle::setConstraints(coor setConstraints, Part* constraintPiece)
 | 
			
		||||
 | 
			
		||||
    //a3
 | 
			
		||||
    this->a3.SetConstraintOnPosition(setConstraints,constraintPiece->m_a3);
 | 
			
		||||
 | 
			
		||||
    //a4
 | 
			
		||||
    this->a4.SetConstraintOnPosition(setConstraints,constraintPiece->m_a4);
 | 
			
		||||
    //TODO!! Add other layer remove here
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -83,6 +83,9 @@ void solve(vector<LogEntry>& log,Puzzle& puzzleMat)
 | 
			
		||||
        case 1://poempelposition
 | 
			
		||||
            puzzleMat.a3.EvaluateQuality(log.back().myCoor,log.back().PieceCollector);
 | 
			
		||||
            break;
 | 
			
		||||
        case 4://SURFFeature
 | 
			
		||||
            puzzleMat.a3.EvaluateQuality(log.back().myCoor,log.back().PieceCollector);
 | 
			
		||||
            break;
 | 
			
		||||
        case -1://random
 | 
			
		||||
            cout << endl;
 | 
			
		||||
            setsolution(log,puzzleMat);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user