Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. help with algorithm

help with algorithm

Scheduled Pinned Locked Moved The Lounge
graphicshelpalgorithmstutorialquestion
10 Posts 8 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Vivek Rajan
    wrote on last edited by
    #1

    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

    R M K P C 6 Replies Last reply
    0
    • V Vivek Rajan

      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

      R Offline
      R Offline
      Robert Dickenson
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • V Vivek Rajan

        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

        M Offline
        M Offline
        Mauricio Ritter
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • V Vivek Rajan

          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

          K Offline
          K Offline
          Kastellanos Nikos
          wrote on last edited by
          #4

          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

          J 1 Reply Last reply
          0
          • K Kastellanos Nikos

            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

            J Offline
            J Offline
            Jon Hulatt
            wrote on last edited by
            #5

            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.

            V 1 Reply Last reply
            0
            • V Vivek Rajan

              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

              P Offline
              P Offline
              Peter Godec
              wrote on last edited by
              #6

              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

              V 1 Reply Last reply
              0
              • V Vivek Rajan

                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

                C Offline
                C Offline
                Chris Losinger
                wrote on last edited by
                #7

                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


                Smaller Animals Software, Inc.

                1 Reply Last reply
                0
                • V Vivek Rajan

                  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

                  D Offline
                  D Offline
                  David Chamberlain
                  wrote on last edited by
                  #8

                  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.

                  1 Reply Last reply
                  0
                  • J Jon Hulatt

                    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.

                    V Offline
                    V Offline
                    Vivek Rajan
                    wrote on last edited by
                    #9

                    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

                    1 Reply Last reply
                    0
                    • P Peter Godec

                      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

                      V Offline
                      V Offline
                      Vivek Rajan
                      wrote on last edited by
                      #10

                      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

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups