Ask Your Question
0

Is there any way to import a .dxf file with open cv?

asked 2016-10-31 02:11:34 -0600

sjanko gravatar image

Hello I'm very new in the opencv world. I have to load a .dxf file with open cv. Is ther any way to do this? Later i have do make a pattern matching with a image which is made by a camera

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-10-31 02:13:54 -0600

berak gravatar image

updated 2016-10-31 02:26:34 -0600

no, there isn't. you will need another external program to convert it to a 2d image (like a png file)

edit flag offensive delete link more

Comments

Thank you for your quick answer. Do you have an idea for an external programm?

sjanko gravatar imagesjanko ( 2016-10-31 02:28:56 -0600 )edit
1

not at all, sorry.

(point is, that your dxf might not even contain a 2d image, only "drawing commands")

berak gravatar imageberak ( 2016-10-31 02:41:50 -0600 )edit
1

I think I do not need a real 2d image. I want to make a pattern matching with the shape, which is stored in dx. format.

sjanko gravatar imagesjanko ( 2016-10-31 02:53:14 -0600 )edit

sure, if you can extract the shape, you probably should do so, and match it against another shape later.

pattern matching is a different beast though, and needs 2d images to work on.

berak gravatar imageberak ( 2016-10-31 02:56:55 -0600 )edit

okay you are absolutly rigth I'm sorry for the missunderstanding. But nervertheless I can't get the shape from the dxf file with opencv rigth?

sjanko gravatar imagesjanko ( 2016-10-31 03:08:03 -0600 )edit

if you have an image, you can extract contours from that via findContours() or houghlines()

opencv just cannot process dxt files directly (proprietary file format)

berak gravatar imageberak ( 2016-10-31 03:12:15 -0600 )edit

So if i could convert dxf into bmp for example. I could make a shaope analysis with tthe bmp file in opencv

sjanko gravatar imagesjanko ( 2016-10-31 03:20:32 -0600 )edit

yes. you can use shape or template matching, then.

berak gravatar imageberak ( 2016-10-31 03:24:51 -0600 )edit

okay thank you very much !

sjanko gravatar imagesjanko ( 2016-10-31 03:44:40 -0600 )edit

Do you know wether there is some way to convert a dxf file to bmp jpeg etc.? Searching for hours but didn't find something usefull. I have to implement it into a give software in c++ ...

sjanko gravatar imagesjanko ( 2016-10-31 10:05:33 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-10-31 02:11:34 -0600

Seen: 2,103 times

Last updated: Oct 31 '16