Skip to content

Commit

Permalink
Add feature computation to sparse RAG
Browse files Browse the repository at this point in the history
  • Loading branch information
jni committed Jun 8, 2017
1 parent 0bf43f1 commit 3f4e307
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion gala/agglo2.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
from . import evaluate as ev
from . import sparselol

from .features import moments


def edge_matrix(labels, connectivity=1):
"""Generate a COO matrix containing the coordinates of edge pixels.
Expand Down Expand Up @@ -270,7 +272,10 @@ def compute_feature_caches(self):
self._cache_boundaries = self.boundary_moments()

def compute_features(self, i, j):
pass
arrs = list(map(moments.central_moments_from_noncentral_sums_py,
[self._cache_nodes[i], self._cache_nodes[j],
self._cache_boundaries[self.graph[i, j]]]))
return np.concatenate(arrs)

# Note can use the data field for actual data since it is redundant with
# the .indices field. OR make your own jitclass.
Expand Down

0 comments on commit 3f4e307

Please sign in to comment.