[mythtv] Commflag samples?

faginbagin mythtv at hbuus.com
Tue Nov 18 05:31:26 UTC 2014


On 11/12/2014 5:40 PM, faginbagin wrote:
> Hi John,
> 
> On 11/10/2014 11:48 PM, faginbagin wrote:
>> Hi John,
>>
>> On 11/10/2014 10:29 AM, John P Poet wrote:
>>> Hi Helen,
>>>
>>> First off, thank you very much for working on the commercial flagging code.  Chris has not had much time to work on MythTV lately, so I have started to slowly go through and review your patches.  I don't have much personal knowledge of this part of the code, so it is a learning process for me.  Unfortunately, my system is often in-use when I have time to work on this, so it could be a little bit before I am finished my review.
>>>
>>> I do have a little bit of bad news:  While testing this, I have come across a show which went from ~95% correct without these patches to about 45% with them.  I plan on trying to narrow down which patch is causing the problem, but it could be a while.  If you are curious, you should be able to grab the problematic episode here:
>>>
>>> https://www.dropbox.com/s/8j8k3500arfkqoj/HellOnWheels.tar?dl=0
>>
>> Thanks for looking at my work. I'm in the process of downloading the troublesome recording now, wget says it will be another 30 minutes.
>>
>> FWIW, my changes are small compared to other comm flagging patches I've seen. The algorithms are unchanged, only what I consider to be bug fixes (esp. the bytesPerLine patch) and adjustments to spatial parameters that significantly improve the accuracy for SD recordings without breaking HD recordings, although it seems you found one. I'll take a look at it and see if I can figure out why the accuracy dropped off so dramatically. I assume, based on the file name that it's a recording of the series "Hell on Wheels" which I think is an AMC series. I don't get basic cable channels in HD, only SD, so my testing of HD material was the broadcast channels. Maybe there's something "interesting" about AMC in HD?
>>
>> I updated the wiki page for mythcommflag to describe the settings it supports. Perhaps my descriptions will help you understand the code? Maybe you'll find I misunderstood something?
>>
>> Regards,
>> Helen
>>
>> P.S. I guess there is no "stash of samples from around the world"?
> 
> I've taken a first look and I suspect the difference is probably due to the one line change in mcf-nologo.patch. However, I don't think the solution is to exclude that patch as it did improve commflagging accuracy for more recordings than not. I think the thing to look at more closely is why didn't mythcommflag find the logo in your recording. Neither the unpatched or patched versions could detect a logo, but there is definitely one there. I will look at that more closely and get back to you.
> 
> Regards,
> Helen

The reason why mythcommflag didn't detect the logo in this particular recording is because the logo is present in fewer than 66% of the first 8 minutes. But it is present in over 60% of the first 8 minutes. I'm attaching a patch that should get the accuracy back to where it was for this recording before my patches. But I'm not so sure it's appropriate for all recordings. In my set of 20 test recordings, I found accuracy dropped 2% on a mark by mark basis. On a per recording basis, accuracy was unchanged for 17 recordings, better for one and worse for 2. I want to review the log files and understand why. I'd also like to spend some time testing Mark Speith's and Bryan's work found in ticket: https://code.mythtv.org/trac/ticket/10793

Regards,
Helen

-------------- next part --------------
diff --git a/mythtv/programs/mythcommflag/ClassicLogoDetector.cpp b/mythtv/programs/mythcommflag/ClassicLogoDetector.cpp
index 287f610..430bfed 100644
--- a/mythtv/programs/mythcommflag/ClassicLogoDetector.cpp
+++ b/mythtv/programs/mythcommflag/ClassicLogoDetector.cpp
@@ -170,7 +170,7 @@ bool ClassicLogoDetector::searchForLogo(MythPlayer* player)
 
                 pos = y * width + x;
 
-                if (edgeCounts[pos].isedge > (maxLoops * 0.66))
+                if (edgeCounts[pos].isedge > (maxLoops * 0.60))
                 {
                     edgeMask[pos].isedge = 1;
                     pixelsInMask++;
@@ -180,15 +180,15 @@ bool ClassicLogoDetector::searchForLogo(MythPlayer* player)
 
                 }
 
-                if (edgeCounts[pos].horiz > (maxLoops * 0.66))
+                if (edgeCounts[pos].horiz > (maxLoops * 0.60))
                     edgeMask[pos].horiz = 1;
 
-                if (edgeCounts[pos].vert > (maxLoops * 0.66))
+                if (edgeCounts[pos].vert > (maxLoops * 0.60))
                     edgeMask[pos].vert = 1;
 
-                if (edgeCounts[pos].ldiag > (maxLoops * 0.66))
+                if (edgeCounts[pos].ldiag > (maxLoops * 0.60))
                     edgeMask[pos].ldiag = 1;
-                if (edgeCounts[pos].rdiag > (maxLoops * 0.66))
+                if (edgeCounts[pos].rdiag > (maxLoops * 0.60))
                     edgeMask[pos].rdiag = 1;
             }
         }



More information about the mythtv-dev mailing list