mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 01:20:25 +08:00
Fixing chessboard generation #1572
This commit is contained in:
@@ -250,17 +250,18 @@ void CalibrationDialog::resetSettings()
|
||||
|
||||
cv::Mat drawChessboard(int squareSize, int boardWidth, int boardHeight, int borderSize)
|
||||
{
|
||||
int imageWidth = squareSize*boardWidth + borderSize;
|
||||
int imageHeight = squareSize*boardHeight + borderSize;
|
||||
cv::Mat chessboard(imageWidth, imageHeight, CV_8UC1, 255);
|
||||
unsigned char color = 0;
|
||||
int imageWidth = squareSize*(boardWidth+1) + 2*borderSize;
|
||||
int imageHeight = squareSize*(boardHeight+1) + 2*borderSize;
|
||||
cv::Mat chessboard(imageHeight, imageWidth, CV_8UC1, 255);
|
||||
unsigned char rowColor = 0;
|
||||
for(int i=borderSize;i<imageHeight-borderSize; i=i+squareSize) {
|
||||
color=~color;
|
||||
unsigned char colColor = rowColor;
|
||||
for(int j=borderSize;j<imageWidth-borderSize;j=j+squareSize) {
|
||||
cv::Mat roi=chessboard(cv::Rect(i,j,squareSize,squareSize));
|
||||
roi.setTo(color);
|
||||
color=~color;
|
||||
cv::Mat roi=chessboard(cv::Rect(j,i,squareSize,squareSize));
|
||||
roi.setTo(colColor);
|
||||
colColor=~colColor;
|
||||
}
|
||||
rowColor = ~rowColor;
|
||||
}
|
||||
return chessboard;
|
||||
}
|
||||
|
||||
@@ -360,7 +360,7 @@
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>2</number>
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>8</number>
|
||||
@@ -373,7 +373,7 @@
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>2</number>
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>6</number>
|
||||
|
||||
Reference in New Issue
Block a user