Is there a way to check if 2D level set function has changed from representing an object of genus 0 to genus 1?

68 Views Asked by At

This question has been moved from stack overflow to here.

My goal is image segmentation but I think my question is a math one:

In computer vision level sets are regularly used to represent moving interfaces. Often the level set function is defined by a signed distance function (SDF). Sometimes the goal in image segmentation is to delineate an object of genus 0, but levels sets change topology quite easily. My question; is there a way to determine if the topology of a level set function has changed?

Here is a sample problem:

This is the image I'm trying to segment:

enter image description here

This is my current result (plotting the zero isocontours of the level set function):

enter image description here

Here is a link to the actual level set function:

link to final SDF

My goal is that the zero level set would consist of just one contour, encircling the galaxy. I want to create a detector function which tells me when the topology changes.