diff --git a/mythtv/programs/mythcommflag/ClassicLogoDetector.cpp b/mythtv/programs/mythcommflag/ClassicLogoDetector.cpp
index dbe6b4a..287f610 100644
a
|
b
|
bool ClassicLogoDetector::searchForLogo(MythPlayer* player) |
101 | 101 | |
102 | 102 | edgeCounts = new EdgeMaskEntry[width * height]; |
103 | 103 | |
| 104 | // Back in 2005, a threshold of 50 minimum pixelsInMask was established. |
| 105 | // I don't know whether that was tested against SD or HD resolutions. |
| 106 | // I do know that in 2010, mythcommflag was changed to use ffmpeg's |
| 107 | // lowres support, effectively dividing the video area by 16. |
| 108 | // But the 50 pixel minimum was not adjusted accordingly. |
| 109 | // I believe the minimum threshold should vary with the video's area. |
| 110 | // I am using 1280x720 (for 720p) video as the baseline. |
| 111 | // This should improve logo detection for SD video. |
| 112 | int minPixelsInMask = 50 * (width*height) / (1280*720 / 16); |
| 113 | |
104 | 114 | for (i = 0; edgeDiffs[i] != 0 && !logoInfoAvailable; i++) |
105 | 115 | { |
106 | 116 | int pixelsInMask = 0; |
107 | 117 | |
108 | | LOG(VB_COMMFLAG, LOG_INFO, QString("Trying with edgeDiff == %1") |
109 | | .arg(edgeDiffs[i])); |
| 118 | LOG(VB_COMMFLAG, LOG_INFO, QString("Trying with edgeDiff == %1, minPixelsInMask=%2") |
| 119 | .arg(edgeDiffs[i]).arg(minPixelsInMask)); |
110 | 120 | |
111 | 121 | memset(edgeCounts, 0, sizeof(EdgeMaskEntry) * width * height); |
112 | 122 | memset(edgeMask, 0, sizeof(EdgeMaskEntry) * width * height); |
… |
… |
bool ClassicLogoDetector::searchForLogo(MythPlayer* player) |
238 | 248 | #endif |
239 | 249 | if (((logoMaxX - logoMinX) < (width / 4)) && |
240 | 250 | ((logoMaxY - logoMinY) < (height / 4)) && |
241 | | (pixelsInMask > 50)) |
| 251 | (pixelsInMask > minPixelsInMask)) |
242 | 252 | { |
243 | 253 | logoInfoAvailable = true; |
244 | 254 | logoEdgeDiff = edgeDiffs[i]; |