Renove black regidon when a board less than the board size is used (Experiamental)
This commit is contained in:
@ -55,11 +55,14 @@ static void seamAjust(std::vector<DetectedPoint>& detections)
|
|||||||
|
|
||||||
Log(Log::DEBUG)<<"Image contains seam";
|
Log(Log::DEBUG)<<"Image contains seam";
|
||||||
|
|
||||||
|
int rightMostPoint = 0;
|
||||||
bool extantCol[X_BOARD_SIZE] = {0};
|
bool extantCol[X_BOARD_SIZE] = {0};
|
||||||
for(auto& point : detections)
|
for(auto& point : detections)
|
||||||
{
|
{
|
||||||
if(!extantCol[point.coordinate.x])
|
if(!extantCol[point.coordinate.x])
|
||||||
extantCol[point.coordinate.x] = true;
|
extantCol[point.coordinate.x] = true;
|
||||||
|
if(point.coordinate.x > rightMostPoint)
|
||||||
|
rightMostPoint = point.coordinate.x;
|
||||||
}
|
}
|
||||||
|
|
||||||
int leftCoordinate = 0;
|
int leftCoordinate = 0;
|
||||||
@ -79,12 +82,13 @@ static void seamAjust(std::vector<DetectedPoint>& detections)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Log(Log::DEBUG)<<"Left coordinate before seam "<<leftCoordinate;
|
Log(Log::DEBUG)<<"Left coordinate before seam "<<leftCoordinate
|
||||||
|
<<" right most "<<rightMostPoint;
|
||||||
|
|
||||||
for(auto& point : detections)
|
for(auto& point : detections)
|
||||||
{
|
{
|
||||||
if(point.coordinate.x < leftCoordinate)
|
if(point.coordinate.x < leftCoordinate)
|
||||||
point.coordinate.x = point.coordinate.x + X_BOARD_SIZE;
|
point.coordinate.x = point.coordinate.x + point.coordinate.x;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ cv::Mat openImageYml(char* fileName)
|
|||||||
cv::FileStorage matf(fileName, cv::FileStorage::READ);
|
cv::FileStorage matf(fileName, cv::FileStorage::READ);
|
||||||
matf["image"]>>image;
|
matf["image"]>>image;
|
||||||
|
|
||||||
if(matf.isOpened() && (!image.data || image.type() != CV_32FC1))
|
if(matf.isOpened() && !image.data)
|
||||||
{
|
{
|
||||||
Log(Log::WARN)<<fileName<<" dose not contain a valid image";
|
Log(Log::WARN)<<fileName<<" dose not contain a valid image";
|
||||||
matf.release();
|
matf.release();
|
||||||
|
Reference in New Issue
Block a user