Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Bug 976121 - Actually do sobelization preprocessing step before getti…

…ng entropy;r=mchang
  • Loading branch information...
commit d1e7b2258bcf939e459dc4f767159f127d5494e0 1 parent b6ecbb5
@wlach wlach authored
View
10 src/eideticker/eideticker/metrics.py
@@ -4,6 +4,7 @@
'input_threshold': 4096,
'stable_frame_analysis_method': 'framediff',
'stable_frame_threshold': 4096,
+ 'sobelize': False,
'animation_threshold': 2048}
# even with median filtering, pointgrey captures tend to have a
@@ -14,6 +15,7 @@
'input_threshold': 4096,
'stable_frame_analysis_method': 'entropy',
'stable_frame_threshold': 3, # 3 times standard deviation, standard
+ 'sobelize': True,
'animation_threshold': 4096
}
@@ -32,8 +34,8 @@ def get_stable_frame_time(capture):
analysis_props = _get_analysis_props(capture.metadata['captureDevice'])
return videocapture.get_stable_frame_time(
capture, method=analysis_props['stable_frame_analysis_method'],
- threshold=analysis_props['stable_frame_threshold'])
-
+ threshold=analysis_props['stable_frame_threshold'],
+ sobelized=analysis_props['sobelize'])
def get_standard_metrics(capture, actions):
analysis_props = _get_analysis_props(capture.metadata['captureDevice'])
@@ -45,7 +47,9 @@ def get_standard_metrics(capture, actions):
capture, threshold=analysis_props['animation_threshold'])
metrics['checkerboard'] = videocapture.get_checkerboarding_area_duration(
capture)
- metrics['overallentropy'] = videocapture.get_overall_entropy(capture)
+ metrics['overallentropy'] = \
+ videocapture.get_overall_entropy(capture,
+ sobelized=analysis_props['sobelize'])
if actions:
# get the delta between the first non-sleep action being fired and
View
12 src/videocapture/videocapture/stableframe.py
@@ -2,7 +2,8 @@
from entropy import get_entropy_diffs
import numpy
-def get_stable_frame(capture, method='framediff', threshold=4096):
+def get_stable_frame(capture, method='framediff', sobelized=False,
+ threshold=4096):
if method == 'framediff':
framediff_sums = get_framediff_sums(capture)
for i in range(len(framediff_sums) - 1, 0, -1):
@@ -10,7 +11,7 @@ def get_stable_frame(capture, method='framediff', threshold=4096):
return i + 1
return len(framediff_sums) - 1
elif method == 'entropy':
- entropy_diffs = get_entropy_diffs(capture)
+ entropy_diffs = get_entropy_diffs(capture, sobelized=sobelized)
standard_deviation = numpy.std(entropy_diffs)
threshold = threshold * standard_deviation
for i in range(len(entropy_diffs) - 1, 0, -1):
@@ -19,6 +20,7 @@ def get_stable_frame(capture, method='framediff', threshold=4096):
return len(entropy_diffs) - 1
-def get_stable_frame_time(capture, method='framediff', threshold=4096):
- return get_stable_frame(capture, method=method,
- threshold=threshold) / float(capture.fps)
+def get_stable_frame_time(capture, method='framediff', threshold=4096,
+ sobelized=False):
+ return get_stable_frame(capture, method=method, threshold=threshold,
+ sobelized=sobelized) / float(capture.fps)
Please sign in to comment.
Something went wrong with that request. Please try again.