schillij95 / ThaumatoAnakalyptor

Automatic Scroll Segmentation Pipline for CT Scans of Herculaneum papyri
MIT License
75 stars 13 forks source link

Edges in graph #26

Open giorgioangel opened 6 days ago

giorgioangel commented 6 days ago

https://github.com/schillij95/ThaumatoAnakalyptor/blob/613a8b1fb680509bbad51a57ad0ce63db65a56d3/ThaumatoAnakalyptor/instances_to_graph.py#L649

Given a patch p in a block A and an overlapping subvolume B, are we adding only in the graph the edge between p and the patch q in B for which the certainty is maximal? Isn't this too restrictive, especially if the estimate of the weight is not accurate?

schillij95 commented 6 days ago

Good point. It might be better to take the top n or so!

How would the ideal graph given our instances look like?

Some ideas:

giorgioangel commented 6 days ago

Top-n seems a good idea!

For the weight function we can use:

  1. Sinkhorn divergence (approx of Wasserstein distance), this gives a similarity in shape
  2. Cosine similarity between eigenvectors of PCA, this gives a proximity in orientation
  3. Relative distance from umbelicus
  4. Relative difference in error of fitting 2.5 surface
  5. ... Others?

We need a weight function that imposes the partial ordering we want and takes into account the highest number possible of "edge-cases"