View Single Post
Old 22nd June 2017, 15:47   #27  |  Link
kriNon
Registered User
 
Join Date: Jul 2016
Posts: 39
So I have spent some time trying to find another better method of detection and I believe I have found one, although I do still need to figure out some of the logic. What I found is that the previous method used relied heavily on Motion Analysis to work, which meant that in some scenarios where there is little to no motion, errors will not be detected.

After doing some testing using a variety of different detection methods, I have found one that I believe will work well. What I found is that it is possible to detect the bad frames using this script:

Code:
video1=MPEG2Source("I:\[NHK]\Welcome to the NHK [DVDISO-PAL]\Disk1\episode1.d2v", cpu=0)
track2=binarize(CombMask(video1)).greyscale().invert()

ConditionalFilter(video1, video1, video1, "AverageLuma(track2)", ">", "0", show=true)
return(last)
Whenever there is an error, the AverageLuma of track2 will fall significantly, relative to the surrounding frames.

As shown in this graph here:http://i.imgur.com/5K71kII.png

It is not possible to check if the AverageLuma of track2 is below a threshold because it changes significantly throughout the episode.
I am in the process of trying to figure out a way of separating these values which do not fit the trend of the graph.
I will also need to use some kind of scene detection to run this test on a per scene basis, because the graph I posted is discontinuous at each scene change.

EDIT:
I have found a way of detecting the outliers in the data using matlab which I will post here:
Code:
%mydata is the array of AverageLuma values
x=1:length(myData);
TF=smooth(x,myData,0.1,'rloess');

Test=(TF-myData)./TF;
for i=1:length(myData)
    if Test(i)<0
        Test(i)=-1;
    elseif Test(i)
    end
end

alpha=0.15;
for i=1:length(myData)
    if Test(i)>alpha
        disp(i);
        disp(Test(i));
    end
end
From here all I would need to do is implement scene detection.

I am thinking maybe it would be best to detect scene changes, output each frame number to a text document with its corresponding scene number and AverageLuma value, and then do all of the logic in matlab.

I'll post my results tomorrow, hopefully this works!

Last edited by kriNon; 22nd June 2017 at 17:49. Reason: Clarification
kriNon is offline   Reply With Quote