added base structure into code
needs picture information expanded evaluation prototype
This commit is contained in:
@ -0,0 +1,56 @@
|
||||
#include "AbstractionLayer_PoempelPosition.h"
|
||||
#include "../../../header.h"
|
||||
|
||||
bool AbstractionLayer_PoempelPosition::PreProcessing(coor mySize, const vector<Part*>* partArray)
|
||||
{
|
||||
//get layer information here
|
||||
cout << "Abstraction Poempel Position Preprocessing... " << flush;
|
||||
|
||||
|
||||
InitialiseConstraintMatrixSize(mySize.col, mySize.row);
|
||||
|
||||
cout << "Done" << endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
//it through qualityVector and removes all that do not trigger PlaceOfPartGood
|
||||
bool AbstractionLayer_PoempelPosition::EvaluateQuality (const coor constraintCoordinate, qualityVector& qVector)
|
||||
{
|
||||
for(int i = 0;i<qVector.size();i++)
|
||||
{
|
||||
float value = PlaceOfPartGood(constraintCoordinate, qVector[i].second->m_a3.SideLength));
|
||||
if(value > 0.8)//TODO find threshold
|
||||
{
|
||||
qVector[i].first=value;
|
||||
continue;
|
||||
}
|
||||
qVector[i].first=0;
|
||||
}
|
||||
}
|
||||
|
||||
bool AbstractionLayer_PoempelPosition::SetConstraintOnPosition(const coor constraintCoordinate, const AbstractionLayer_PoempelPosition_Properties constraint)
|
||||
{
|
||||
m_constraintMatrix[constraintCoordinate.col][constraintCoordinate.row].SideLength=constraint.SideLength;
|
||||
}
|
||||
|
||||
bool AbstractionLayer_PoempelPosition::RemoveConstraintOnPosition(const coor constraintCoordinate)
|
||||
{
|
||||
m_constraintMatrix[constraintCoordinate.col][constraintCoordinate.row].SideLength={0,0,0,0,0,0,0,0};
|
||||
}
|
||||
|
||||
float AbstractionLayer_PoempelPosition::PlaceOfPartGood(coor myCoor, vector<float> myPart)
|
||||
{
|
||||
//sets coordinates to correct position for layer
|
||||
|
||||
//create negativePart, watch out for edges
|
||||
|
||||
//check vector against negative part
|
||||
|
||||
//return of well it fits within threshold
|
||||
}
|
||||
|
||||
//shifts vector i steps to the right (8-2i to the left)
|
||||
void AbstractionLayer_PoempelPosition_Properties::shift(int i)
|
||||
{
|
||||
rotate(SideLength.begin(),SideLength.begin()+(8-2*i),SideLength.end());
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
#include "AbstractionLayer_PoempelPosition_Properties.h"
|
||||
#include "../AbstraktionLayer_Base.h"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
|
||||
class AbstractionLayer_PoempelPosition : public AbstractionLayer_Base<AbstractionLayer_PoempelPosition_Properties>
|
||||
{
|
||||
public:
|
||||
bool PreProcessing(coor mySize, const vector<Part*>* partArray) final ;
|
||||
bool EvaluateQuality ( coor constraintCoordinate, qualityVector& qVector)final;
|
||||
bool SetConstraintOnPosition( coor constraintCoordinate, AbstractionLayer_PoempelPosition_Properties constraint)final;
|
||||
bool RemoveConstraintOnPosition( coor constraintCoordinate)final;
|
||||
|
||||
float PlaceOfPartGood(coor myCoor, vector<float> myPart);
|
||||
|
||||
private:
|
||||
};
|
@ -0,0 +1,17 @@
|
||||
|
||||
#pragma once
|
||||
#include <vector>
|
||||
using namespace std;
|
||||
class AbstractionLayer_PoempelPosition_Properties
|
||||
{
|
||||
public:
|
||||
AbstractionLayer_PoempelPosition_Properties():SideLength({0,0,0,0,0,0,0,0}){}
|
||||
float getSideLength(int i){if (i<8 && i>=0)return SideLength[i]; else return -1;};
|
||||
void shift(int i);
|
||||
private:
|
||||
|
||||
vector<float> SideLength;
|
||||
friend class AbstractionLayer_PoempelPosition;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user