I'm currently trying to take a 2d profile generated in SolidWorks and use mathematica to analyze it. I need to pull lines that represent the boundaries of the shape from an image of the shape. . My current approach is to save the profile as a jpg/png in solidworks, then importing that image to mathematica. I've tried a lot of things, with varying degrees of success:
img = Binarize[
Import["https://i.sstatic.net/BNRjk.png"]]
edges = ImageLines[EdgeDetect[img],
Method -> {"Hough",
"Segmented" ->
True}](*EDGES HOLDS LINES WHICH CORRESPOND TO EACH EDGE OF THE \
SHAPE*)
edgeimg = Graphics[{Thick, Orange, Line /@ edges}]
MorphologicalTransform[img, "Commonest"]
Has gotten me the closest, but it's far from perfect. Has anyone tried anything similar and had any success? Also, I started learning mathematica yesterday, which is also the first time I've tried image processing, so some explanation of the code would be really nice if it's really convoluted.
The end goal is that I have different lines that fully describe the profile of my object that can be individually selected.
BONUS: I have literally no clue how to incorporate curves into something like this, but that's another goal.