help with algorithm
-
Hello CPians- I was wondering if anyone could help me find more information for a project i am working on. The problem ----------- I want to input a scanned image (fairly high quality engineering drawing of shelves) into my application and generate a vector graphics representation. IN other words, the scanned image is basically converted into a series of geometric shapes like lines/circles/rectangles/ellipses etc. I guess that would involve detecting shapes in an image. I am familiar with basic image processing techniques like edge detection. I just have no idea how to detect these shapes. Currently I am working on a project that displays these images (typically engg drawings of some empty shelves) as bitmaps. The problem is I want them to scale smoothly. Currently, the scaling is a problem because when I shrink the bitmap, the "all-important lines" disappear, because StretchBlt is not too sophisticated. The problem is simplified by the fact that the only 3 shapes present in the drawing are straight lines, rectangles, circles. There is also some text & other shapes which I can ignore. Dont postscript printers do this all the time ? Can anyone give me some ideas/pointers ? I will share the code when I find a way to do this Thanks in advance vivek
-
Hello CPians- I was wondering if anyone could help me find more information for a project i am working on. The problem ----------- I want to input a scanned image (fairly high quality engineering drawing of shelves) into my application and generate a vector graphics representation. IN other words, the scanned image is basically converted into a series of geometric shapes like lines/circles/rectangles/ellipses etc. I guess that would involve detecting shapes in an image. I am familiar with basic image processing techniques like edge detection. I just have no idea how to detect these shapes. Currently I am working on a project that displays these images (typically engg drawings of some empty shelves) as bitmaps. The problem is I want them to scale smoothly. Currently, the scaling is a problem because when I shrink the bitmap, the "all-important lines" disappear, because StretchBlt is not too sophisticated. The problem is simplified by the fact that the only 3 shapes present in the drawing are straight lines, rectangles, circles. There is also some text & other shapes which I can ignore. Dont postscript printers do this all the time ? Can anyone give me some ideas/pointers ? I will share the code when I find a way to do this Thanks in advance vivek
Vivek Rajan wrote: Currently, the scaling is a problem because when I shrink the bitmap, the "all-important lines" disappear, because StretchBlt is not too sophisticated. Try place the bitmap into microsoft word, (yes the word processor). Many years back I used word to resize bitmaps simply because it worked very nicely when others programs fell short. Good luck, Robert. sonork ID: 100.9940
-
Hello CPians- I was wondering if anyone could help me find more information for a project i am working on. The problem ----------- I want to input a scanned image (fairly high quality engineering drawing of shelves) into my application and generate a vector graphics representation. IN other words, the scanned image is basically converted into a series of geometric shapes like lines/circles/rectangles/ellipses etc. I guess that would involve detecting shapes in an image. I am familiar with basic image processing techniques like edge detection. I just have no idea how to detect these shapes. Currently I am working on a project that displays these images (typically engg drawings of some empty shelves) as bitmaps. The problem is I want them to scale smoothly. Currently, the scaling is a problem because when I shrink the bitmap, the "all-important lines" disappear, because StretchBlt is not too sophisticated. The problem is simplified by the fact that the only 3 shapes present in the drawing are straight lines, rectangles, circles. There is also some text & other shapes which I can ignore. Dont postscript printers do this all the time ? Can anyone give me some ideas/pointers ? I will share the code when I find a way to do this Thanks in advance vivek
I´ve created something similar... with bitmaps... but it uses color-keying to create the shapes (polygons). I think I haven´t deleted it... I´ll try to locate it for you... Mauricio Teichmann Ritter Brazil mauricioritter@hotmail.com
-
Hello CPians- I was wondering if anyone could help me find more information for a project i am working on. The problem ----------- I want to input a scanned image (fairly high quality engineering drawing of shelves) into my application and generate a vector graphics representation. IN other words, the scanned image is basically converted into a series of geometric shapes like lines/circles/rectangles/ellipses etc. I guess that would involve detecting shapes in an image. I am familiar with basic image processing techniques like edge detection. I just have no idea how to detect these shapes. Currently I am working on a project that displays these images (typically engg drawings of some empty shelves) as bitmaps. The problem is I want them to scale smoothly. Currently, the scaling is a problem because when I shrink the bitmap, the "all-important lines" disappear, because StretchBlt is not too sophisticated. The problem is simplified by the fact that the only 3 shapes present in the drawing are straight lines, rectangles, circles. There is also some text & other shapes which I can ignore. Dont postscript printers do this all the time ? Can anyone give me some ideas/pointers ? I will share the code when I find a way to do this Thanks in advance vivek
As i can understand you just need a better scale algorithm. Try to find a better scale insteand of going the long way. - - - - - - - - - - - - - - - - - - Memory leaks is the price we pay \0 01234567890123456789012345678901234
-
As i can understand you just need a better scale algorithm. Try to find a better scale insteand of going the long way. - - - - - - - - - - - - - - - - - - Memory leaks is the price we pay \0 01234567890123456789012345678901234
Adobe Streamline is a commerical app that turns bitmaps into lineart (.AI). You might check it out; unless you *need* to write your own. Sorry to dissapoint you all with my lack of a witty or poignant signature.
-
Hello CPians- I was wondering if anyone could help me find more information for a project i am working on. The problem ----------- I want to input a scanned image (fairly high quality engineering drawing of shelves) into my application and generate a vector graphics representation. IN other words, the scanned image is basically converted into a series of geometric shapes like lines/circles/rectangles/ellipses etc. I guess that would involve detecting shapes in an image. I am familiar with basic image processing techniques like edge detection. I just have no idea how to detect these shapes. Currently I am working on a project that displays these images (typically engg drawings of some empty shelves) as bitmaps. The problem is I want them to scale smoothly. Currently, the scaling is a problem because when I shrink the bitmap, the "all-important lines" disappear, because StretchBlt is not too sophisticated. The problem is simplified by the fact that the only 3 shapes present in the drawing are straight lines, rectangles, circles. There is also some text & other shapes which I can ignore. Dont postscript printers do this all the time ? Can anyone give me some ideas/pointers ? I will share the code when I find a way to do this Thanks in advance vivek
Wow. This problem is extremely non-trivial. Some time ago i've implemented line extraction using Hough transform (google it). Generalized HT can be used to detect any kind of parametric curve, although algorithm complexity grows exponentially with the number of parameters (e.g. two parameters for lines, three parameters for circles). HT is a simple algorithm once you grok it. The real difficulties are determining how to quantize the parameter space (accuracy vs. speed) and how to extract curve parameters from it. The one link i can give you: http://www.icaen.uiowa.edu/~dip/LECTURE/Segmentation2.html#hough
-
Hello CPians- I was wondering if anyone could help me find more information for a project i am working on. The problem ----------- I want to input a scanned image (fairly high quality engineering drawing of shelves) into my application and generate a vector graphics representation. IN other words, the scanned image is basically converted into a series of geometric shapes like lines/circles/rectangles/ellipses etc. I guess that would involve detecting shapes in an image. I am familiar with basic image processing techniques like edge detection. I just have no idea how to detect these shapes. Currently I am working on a project that displays these images (typically engg drawings of some empty shelves) as bitmaps. The problem is I want them to scale smoothly. Currently, the scaling is a problem because when I shrink the bitmap, the "all-important lines" disappear, because StretchBlt is not too sophisticated. The problem is simplified by the fact that the only 3 shapes present in the drawing are straight lines, rectangles, circles. There is also some text & other shapes which I can ignore. Dont postscript printers do this all the time ? Can anyone give me some ideas/pointers ? I will share the code when I find a way to do this Thanks in advance vivek
Might try a better resizing method (bi-cubic interpoliation or something like a Sinc filter) then do an "unsharp mask" and finally a simple "sharpen". This is what I do when scanning images. All of this will revive small details that might have been lost otherwise. It's certainly easier than the kind of stuff you'd need for a real shape-identification thing. Postscript works by simply drawing the shapes smaller (it moves the verticies around). -c
-
Hello CPians- I was wondering if anyone could help me find more information for a project i am working on. The problem ----------- I want to input a scanned image (fairly high quality engineering drawing of shelves) into my application and generate a vector graphics representation. IN other words, the scanned image is basically converted into a series of geometric shapes like lines/circles/rectangles/ellipses etc. I guess that would involve detecting shapes in an image. I am familiar with basic image processing techniques like edge detection. I just have no idea how to detect these shapes. Currently I am working on a project that displays these images (typically engg drawings of some empty shelves) as bitmaps. The problem is I want them to scale smoothly. Currently, the scaling is a problem because when I shrink the bitmap, the "all-important lines" disappear, because StretchBlt is not too sophisticated. The problem is simplified by the fact that the only 3 shapes present in the drawing are straight lines, rectangles, circles. There is also some text & other shapes which I can ignore. Dont postscript printers do this all the time ? Can anyone give me some ideas/pointers ? I will share the code when I find a way to do this Thanks in advance vivek
If you have something like Visio, you could load your bitmap and then create new shapes on top of the image. When you remove your image, you're left with the shapes. Kind of like copying using tracing paper. Since you have fairly simplistic shapes, it shouldn't be too hard to do it by hand this way. One of the complexities of doing it automatically is determining which shape a common vertex would belong to, and with something like shelves, I'm sure there would be many common vertices. In the end, you're going to end up with a set of vectors anyway, so why not just make up a new diagram with your favorite drawing tool? Dave "You can say that again." -- Dept. of Redundancy Dept.
-
Adobe Streamline is a commerical app that turns bitmaps into lineart (.AI). You might check it out; unless you *need* to write your own. Sorry to dissapoint you all with my lack of a witty or poignant signature.
JOhn - Thanks for the tip. That seems to be along the lines of what I am looking for. Is the .AI (lineart) format public. I dont mind paying $122 as a one-time cost. From the product literature it seems to be designed specifically as an add-on to Adobe Illustrator. Thanks - Vivek
-
Wow. This problem is extremely non-trivial. Some time ago i've implemented line extraction using Hough transform (google it). Generalized HT can be used to detect any kind of parametric curve, although algorithm complexity grows exponentially with the number of parameters (e.g. two parameters for lines, three parameters for circles). HT is a simple algorithm once you grok it. The real difficulties are determining how to quantize the parameter space (accuracy vs. speed) and how to extract curve parameters from it. The one link i can give you: http://www.icaen.uiowa.edu/~dip/LECTURE/Segmentation2.html#hough
Peter - Thanks a lot for the tip. I am reading up on Hough transforms. It is pretty exciting. Scaling is only one of the reasons I want to do this. I want to identify slots in the shelves and assign equipment that can be placed in each slot. In other words, I really need to convert the bitmap into something that has "meaning". I could, in theory go after the CAD files for these shelves. They are hard to obtain, even if I can get them they are in arcane formats (like DXF). Thanks- Vivek