mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Rewrite of black border detector to fix problems with overscan and xbmc video calibration settings
Former-commit-id: ed6dd4e6872ea69d682096a82e108a3f7e7ca4ae
This commit is contained in:
@@ -45,7 +45,7 @@ int TC_NO_BORDER()
|
||||
{
|
||||
RgbImage image = createImage(64, 64, 0, 0);
|
||||
BlackBorder border = detector.process(image);
|
||||
if (border.type != BlackBorder::none)
|
||||
if (border.unknown != false && border.horizontalSize != 0 && border.verticalSize != 0)
|
||||
{
|
||||
std::cerr << "Failed to correctly detect no border" << std::endl;
|
||||
result = -1;
|
||||
@@ -64,7 +64,7 @@ int TC_TOP_BORDER()
|
||||
{
|
||||
RgbImage image = createImage(64, 64, 12, 0);
|
||||
BlackBorder border = detector.process(image);
|
||||
if (border.type != BlackBorder::horizontal || border.size != 12)
|
||||
if (border.unknown != false && border.horizontalSize != 12 && border.verticalSize != 0)
|
||||
{
|
||||
std::cerr << "Failed to correctly detect horizontal border with correct size" << std::endl;
|
||||
result = -1;
|
||||
@@ -83,7 +83,7 @@ int TC_LEFT_BORDER()
|
||||
{
|
||||
RgbImage image = createImage(64, 64, 0, 12);
|
||||
BlackBorder border = detector.process(image);
|
||||
if (border.type != BlackBorder::vertical || border.size != 12)
|
||||
if (border.unknown != false && border.horizontalSize != 0 && border.verticalSize != 12)
|
||||
{
|
||||
std::cerr << "Failed to detected vertical border with correct size" << std::endl;
|
||||
result = -1;
|
||||
@@ -93,6 +93,24 @@ int TC_LEFT_BORDER()
|
||||
return result;
|
||||
}
|
||||
|
||||
int TC_DUAL_BORDER()
|
||||
{
|
||||
int result = 0;
|
||||
|
||||
BlackBorderDetector detector;
|
||||
|
||||
{
|
||||
RgbImage image = createImage(64, 64, 12, 12);
|
||||
BlackBorder border = detector.process(image);
|
||||
if (border.unknown != false && border.horizontalSize != 12 && border.verticalSize != 12)
|
||||
{
|
||||
std::cerr << "Failed to detected two-sided border" << std::endl;
|
||||
result = -1;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
int TC_UNKNOWN_BORDER()
|
||||
{
|
||||
int result = 0;
|
||||
@@ -100,9 +118,9 @@ int TC_UNKNOWN_BORDER()
|
||||
BlackBorderDetector detector;
|
||||
|
||||
{
|
||||
RgbImage image = createImage(64, 64, 12, 12);
|
||||
RgbImage image = createImage(64, 64, 30, 30);
|
||||
BlackBorder border = detector.process(image);
|
||||
if (border.type != BlackBorder::unknown)
|
||||
if (border.unknown != true)
|
||||
{
|
||||
std::cerr << "Failed to detected unknown border" << std::endl;
|
||||
result = -1;
|
||||
@@ -116,6 +134,7 @@ int main()
|
||||
TC_NO_BORDER();
|
||||
TC_TOP_BORDER();
|
||||
TC_LEFT_BORDER();
|
||||
TC_DUAL_BORDER();
|
||||
TC_UNKNOWN_BORDER();
|
||||
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user