Ejemplo n.º 1
0
 public void Render(bool[,] state)
 {
     for (int row = 0; row < 8; row++)
     {
         for (int col = 0; col < 8; col++)
         {
             var color = state[row, col] ? Scalar.White :
                         (HistChessboardModel.IsWhiteSquare(row, col) ? WhiteColor : BlackColor);
             Cv2.Rectangle(
                 img: Output,
                 pt1: new Point(row * SquareSize, col * SquareSize),
                 pt2: new Point((row + 1) * SquareSize, (col + 1) * SquareSize),
                 color: color,
                 thickness: -1);
         }
     }
     outWin.ShowImage(Output);
 }
Ejemplo n.º 2
0
 public void Render(SquareClassificationScores[,] scores)
 {
     for (int row = 0; row < 8; row++)
     {
         for (int col = 0; col < 8; col++)
         {
             var squareState = scores[row, col].MostLikely;
             var color       = squareState ==
                               SquareState.White ? Scalar.White :
                               (squareState == SquareState.Black ? Scalar.Black :
                                (HistChessboardModel.IsWhiteSquare(row, col) ? WhiteColor : BlackColor));
             Cv2.Rectangle(
                 img: Output,
                 pt1: new Point(row * SquareSize, col * SquareSize),
                 pt2: new Point((row + 1) * SquareSize, (col + 1) * SquareSize),
                 color: color,
                 thickness: -1);
         }
     }
     outWin.ShowImage(Output);
 }