use of br.edu.ifspsaocarlos.sdm.kifurecorder.models.Game in project kifu-recorder by leonardost.
the class RecordGameActivity method initializeProcessing.
private void initializeProcessing() {
Intent i = getIntent();
String blackPlayer = i.getStringExtra("blackPlayer");
String whitePlayer = i.getStringExtra("whitePlayer");
String komi = i.getStringExtra("komi");
boardDimension = i.getIntExtra("boardDimension", -1);
int[] foundBoardCorners = i.getIntArrayExtra("boardPositionInImage");
stoneDetector.setBoardDimension(boardDimension);
game = new Game(boardDimension, blackPlayer, whitePlayer, komi);
lastDetectedBoard = new Board(boardDimension);
timeOfLastBoardDetection = SystemClock.elapsedRealtime();
timeSinceLastBoardChange = 0;
timeOfLastImageProcessing = SystemClock.elapsedRealtime();
originalBoardCorners = new Corner[4];
originalBoardCorners[0] = new Corner(foundBoardCorners[0], foundBoardCorners[1]);
originalBoardCorners[1] = new Corner(foundBoardCorners[2], foundBoardCorners[3]);
originalBoardCorners[2] = new Corner(foundBoardCorners[4], foundBoardCorners[5]);
originalBoardCorners[3] = new Corner(foundBoardCorners[6], foundBoardCorners[7]);
boardCorners = new Corner[4];
boardCorners[0] = new Corner(foundBoardCorners[0], foundBoardCorners[1]);
boardCorners[1] = new Corner(foundBoardCorners[2], foundBoardCorners[3]);
boardCorners[2] = new Corner(foundBoardCorners[4], foundBoardCorners[5]);
boardCorners[3] = new Corner(foundBoardCorners[6], foundBoardCorners[7]);
cornerDetector = new CornerDetector[4];
for (int cornerIndex = 0; cornerIndex < 4; cornerIndex++) {
cornerDetector[cornerIndex] = new CornerDetector();
cornerDetector[cornerIndex].setCorner(boardCorners[cornerIndex]);
cornerDetector[cornerIndex].setCornerIndex(cornerIndex + 1);
}
processBoardCorners();
}
Aggregations