Pulling the boundaries from a Solidworks Profile in Mathematica

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["http://i.stack.imgur.com/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.

• Is there no format in common between these applications? – Mr.Wizard May 21 '15 at 16:40
• Related: (13918), (18167) – Mr.Wizard May 21 '15 at 16:41
• Why don't you also include an example profile where your code doesn't work? – Mr.Wizard May 21 '15 at 16:46
• Which version of Mathematica are you using? In 10.1 I get this: i.stack.imgur.com/LHyj4.png -- which looks pretty good to me. Before attempting to improve this though I ask again: is there no format in common that you could export in? – Mr.Wizard May 21 '15 at 19:08
• Thanks for asking twice. I googled harder and discovered that dxf files are reasonably compatible with mathematica. – PCK May 21 '15 at 19:32

im=Import["C:\\Users\\Leandro\\Desktop\\Arco.dxf","Graphics3D"] InputForm[%]

Export["image.png",im, ImageResolution -> 360]