From 8a1bad10455f8ec0c47b692f5460d64a90f8049b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Priv=C3=A9?= Date: Fri, 4 Nov 2022 10:18:46 +0100 Subject: [PATCH] simplify --- disparity.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/disparity.py b/disparity.py index de6db23..580e717 100755 --- a/disparity.py +++ b/disparity.py @@ -31,20 +31,11 @@ def get_nes (graph, label): return set([node_id]).union(set([id for id in graph.neighbors(node_id)])) -def disparity_integral (x, k): - """ - calculate the definite integral for the PDF in the disparity filter - """ - assert x != 1.0, "x == 1.0" - assert k != 1.0, "k == 1.0" - return ((1.0 - x)**k) / ((k - 1.0) * (x - 1.0)) - - def get_disparity_significance (norm_weight, degree): """ calculate the significance (alpha) for the disparity filter """ - return 1.0 - ((degree - 1.0) * (disparity_integral(norm_weight, degree) - disparity_integral(0.0, degree))) + return (1.0 - norm_weight)**(degree - 1.0) def disparity_filter (graph):