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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Algorithms
  4. AI ?

AI ?

Scheduled Pinned Locked Moved Algorithms
question
12 Posts 5 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.
  • M Offline
    M Offline
    Mohammad Dayyan
    wrote on last edited by
    #1

    Hi. Do you know any algorithms for detecting a shape in an image ? thanks in advance.

    L J A P 4 Replies Last reply
    0
    • M Mohammad Dayyan

      Hi. Do you know any algorithms for detecting a shape in an image ? thanks in advance.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      hough transform : for curve responses harris coner and sobel edge detectors : for macro or constellation features this kind of problem is studied within computer vision.

      1 Reply Last reply
      0
      • M Mohammad Dayyan

        Hi. Do you know any algorithms for detecting a shape in an image ? thanks in advance.

        J Offline
        J Offline
        jk chan
        wrote on last edited by
        #3

        Hough transform can help you in simple shape detection like line circle etc.. You better look PDM(Probability density models ), these can detect shapes. PDM need to be initialized with a training set , after that it will calculate PCA . PDM is not that difficult.. have a look.

        If u can Dream... U can do it

        1 Reply Last reply
        0
        • M Mohammad Dayyan

          Hi. Do you know any algorithms for detecting a shape in an image ? thanks in advance.

          A Offline
          A Offline
          Alan Balkany
          wrote on last edited by
          #4

          Mathematical morphology provides simpler and more efficient tools for detecting shapes and more. The fundamental operations are dilation and erosion. This http://www.ph.tn.tudelft.nl/Courses/FIP/noframes/fip-Morpholo.html[^] covers some of the basics (but it makes the concepts look harder than they are). This one http://www.dca.fee.unicamp.br/dipcourse/html-dip/c9/s4/front-page.html[^] has some nice pictures, but is short on explanation. If you could describe the task you're trying to accomplish, maybe I could make some more specific recommendations.

          M 1 Reply Last reply
          0
          • A Alan Balkany

            Mathematical morphology provides simpler and more efficient tools for detecting shapes and more. The fundamental operations are dilation and erosion. This http://www.ph.tn.tudelft.nl/Courses/FIP/noframes/fip-Morpholo.html[^] covers some of the basics (but it makes the concepts look harder than they are). This one http://www.dca.fee.unicamp.br/dipcourse/html-dip/c9/s4/front-page.html[^] has some nice pictures, but is short on explanation. If you could describe the task you're trying to accomplish, maybe I could make some more specific recommendations.

            M Offline
            M Offline
            Mohammad Dayyan
            wrote on last edited by
            #5

            Great, thanks

            Alan Balkany wrote:

            If you could describe the task you're trying to accomplish, maybe I could make some more specific recommendations.

            Actually , I'm going to detect some shapes (likes circle or rectangles or complex shapes ) in an AVI file or a stream video from WebCam with C# . Do you have any advices ?

            A 1 Reply Last reply
            0
            • M Mohammad Dayyan

              Great, thanks

              Alan Balkany wrote:

              If you could describe the task you're trying to accomplish, maybe I could make some more specific recommendations.

              Actually , I'm going to detect some shapes (likes circle or rectangles or complex shapes ) in an AVI file or a stream video from WebCam with C# . Do you have any advices ?

              A Offline
              A Offline
              Alan Balkany
              wrote on last edited by
              #6

              Once you get your image into a bitmap, morphology provides operations you can use to simplify the image, so it's easier to detect the shape you're looking for. For example, to detect circles with diameter d, doing an erosion by a diameter d circle should result in a single point for every circle in the image. Many systems have morphological operations built in, which is the easiest way to do it. You can also implement your own, but this is harder and requires specialized knowledge. I found a better link for morphology: http://en.wikipedia.org/wiki/Morphological_image_processing[^]. This includes links to free function libraries that do this.

              M 1 Reply Last reply
              0
              • A Alan Balkany

                Once you get your image into a bitmap, morphology provides operations you can use to simplify the image, so it's easier to detect the shape you're looking for. For example, to detect circles with diameter d, doing an erosion by a diameter d circle should result in a single point for every circle in the image. Many systems have morphological operations built in, which is the easiest way to do it. You can also implement your own, but this is harder and requires specialized knowledge. I found a better link for morphology: http://en.wikipedia.org/wiki/Morphological_image_processing[^]. This includes links to free function libraries that do this.

                M Offline
                M Offline
                Mohammad Dayyan
                wrote on last edited by
                #7

                Thanks a lot Alan. What about http://www.aforgenet.com/[^] ? Is it a good stuff to do that ?

                A 1 Reply Last reply
                0
                • M Mohammad Dayyan

                  Thanks a lot Alan. What about http://www.aforgenet.com/[^] ? Is it a good stuff to do that ?

                  A Offline
                  A Offline
                  Alan Balkany
                  wrote on last edited by
                  #8

                  Yes, that looks excellent. It has morphology and much more.

                  M 1 Reply Last reply
                  0
                  • A Alan Balkany

                    Yes, that looks excellent. It has morphology and much more.

                    M Offline
                    M Offline
                    Mohammad Dayyan
                    wrote on last edited by
                    #9

                    Thanks a lot Alan Balkany for answers.

                    A 1 Reply Last reply
                    0
                    • M Mohammad Dayyan

                      Thanks a lot Alan Balkany for answers.

                      A Offline
                      A Offline
                      Alan Balkany
                      wrote on last edited by
                      #10

                      You're welcome!

                      1 Reply Last reply
                      0
                      • M Mohammad Dayyan

                        Hi. Do you know any algorithms for detecting a shape in an image ? thanks in advance.

                        P Offline
                        P Offline
                        PredictorX
                        wrote on last edited by
                        #11

                        Assuming that these are simple geometric shapes on relatively simple backgrounds (as opposed to real objects against cluttered backgrounds), then I'd suggest: 1. Determine which pixels are foreground (shapes) and background (everything else) 2. Identify individual blobs (connected sets of foreground pixels of the same type) 3. For each blob, extract meaningful features 4. Train a classifier, based on the extracted features 5. Test the system on new images 6. Celebrate! In step 2, try using a flood fill. In step 3, there are many features one might try, such as perimeter-to-area ratio. In step 4, the classifier could be any learning algorithm: neural network, linear discriminant, etc. -Will Dwinnell Data Mining in MATLAB

                        M 1 Reply Last reply
                        0
                        • P PredictorX

                          Assuming that these are simple geometric shapes on relatively simple backgrounds (as opposed to real objects against cluttered backgrounds), then I'd suggest: 1. Determine which pixels are foreground (shapes) and background (everything else) 2. Identify individual blobs (connected sets of foreground pixels of the same type) 3. For each blob, extract meaningful features 4. Train a classifier, based on the extracted features 5. Test the system on new images 6. Celebrate! In step 2, try using a flood fill. In step 3, there are many features one might try, such as perimeter-to-area ratio. In step 4, the classifier could be any learning algorithm: neural network, linear discriminant, etc. -Will Dwinnell Data Mining in MATLAB

                          M Offline
                          M Offline
                          Mohammad Dayyan
                          wrote on last edited by
                          #12

                          Thank a lot for the reply. I'm gonna using C# .

                          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