Open ghost opened 2 years ago
this should be a post process. sknw transform image to vector graph, then you can use some geometry lib (such as shape ly) to simplify the edge.
this is a demo generated by chatgpt, It seems ok, but I did not test it
from shapely.geometry import LineString, Point
# Define a line string
line = LineString([(0, 0), (0, 1), (1, 1), (2, 2), (3, 1), (4, 0)])
# Simplify the line string with a tolerance of 0.5
simplified_line = line.simplify(tolerance=0.5, preserve_topology=False)
# Print the original and simplified line strings
print("Original line: ", line)
print("Simplified line: ", simplified_line)
Hello. I found this package to make floorplan Binary Image to graph like this. I make it to skeleton image and result is here. Is it possible to add angled parts where i pointed by arrows to a graph as points?
also ,I wish the graph was composed only of straight lines... is any options?