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. General Programming
  3. Algorithms
  4. Counting bricks from image

Counting bricks from image

Scheduled Pinned Locked Moved Algorithms
questionalgorithmshelp
9 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.
  • A Offline
    A Offline
    asiv
    wrote on last edited by
    #1

    Hi everyone, I have a small question, for my school project i need to make a program for counting brick in image. So I have a picture with nothing but bricks on it, and i need to count them, the idea i have is to use Sobel algorithm, blur, binaryzation and region search, something like that. Is is the right way to go, or is there any better one? Thank you all for your help!

    M A 2 Replies Last reply
    0
    • A asiv

      Hi everyone, I have a small question, for my school project i need to make a program for counting brick in image. So I have a picture with nothing but bricks on it, and i need to count them, the idea i have is to use Sobel algorithm, blur, binaryzation and region search, something like that. Is is the right way to go, or is there any better one? Thank you all for your help!

      M Offline
      M Offline
      Matthew Butler 0
      wrote on last edited by
      #2

      I would say you have it spot on... filter the image and then apply a region counting algorithm. The filtering is relatively simple... but the region finding could be harder (I've never used/made one). If you get the original image down to just the outlines of the bricks (via the filters), then you could use a Monte-Carlo based search to look for borders surrounding each point. [I wish I had a school project as interesting as yours!]

      Matthew Butler

      A 1 Reply Last reply
      0
      • M Matthew Butler 0

        I would say you have it spot on... filter the image and then apply a region counting algorithm. The filtering is relatively simple... but the region finding could be harder (I've never used/made one). If you get the original image down to just the outlines of the bricks (via the filters), then you could use a Monte-Carlo based search to look for borders surrounding each point. [I wish I had a school project as interesting as yours!]

        Matthew Butler

        A Offline
        A Offline
        asiv
        wrote on last edited by
        #3

        Hmm ya all i need is some guidance where i can get this algorithms implemented in C#. Thnx for your reply.

        T 1 Reply Last reply
        0
        • A asiv

          Hmm ya all i need is some guidance where i can get this algorithms implemented in C#. Thnx for your reply.

          T Offline
          T Offline
          Tim Craig
          wrote on last edited by
          #4

          Member 3897207 wrote:

          all i need is some guidance where i can get this algorithms implemented in C#.

          First, you ask for some advice on if your approach to the problem, which is fine. But now you respond to Mathew's advice saying you just want help on how to cheat to do your homework. I was going add a litte to his advice but now I won't and you'll probably not get any further help.

          2 75 22 6

          A 1 Reply Last reply
          0
          • T Tim Craig

            Member 3897207 wrote:

            all i need is some guidance where i can get this algorithms implemented in C#.

            First, you ask for some advice on if your approach to the problem, which is fine. But now you respond to Mathew's advice saying you just want help on how to cheat to do your homework. I was going add a litte to his advice but now I won't and you'll probably not get any further help.

            2 75 22 6

            A Offline
            A Offline
            asiv
            wrote on last edited by
            #5

            Well what can i say...basically this came out wrong, because i found some algorithms, but they are written in java, so i wondered if there is any...ok...not just for this problem, but if there is any site with algorithms (general) where code is in C#. Well if i don't get any help any more...so be it. Thnx anyway at least for confirming that the approach is at least a bit correct.

            M T 2 Replies Last reply
            0
            • A asiv

              Well what can i say...basically this came out wrong, because i found some algorithms, but they are written in java, so i wondered if there is any...ok...not just for this problem, but if there is any site with algorithms (general) where code is in C#. Well if i don't get any help any more...so be it. Thnx anyway at least for confirming that the approach is at least a bit correct.

              M Offline
              M Offline
              MarkB777
              wrote on last edited by
              #6

              C# is very similar to Java (C# partly originated from it). You should be able to translate the code with little hassle. If you get stuck, post your code, and so long as your question is reasonable, we'd be happy to help.

              Mark Brock Click here to view my blog

              1 Reply Last reply
              0
              • A asiv

                Well what can i say...basically this came out wrong, because i found some algorithms, but they are written in java, so i wondered if there is any...ok...not just for this problem, but if there is any site with algorithms (general) where code is in C#. Well if i don't get any help any more...so be it. Thnx anyway at least for confirming that the approach is at least a bit correct.

                T Offline
                T Offline
                Tim Craig
                wrote on last edited by
                #7

                Yes, to echo what Mark said. The way to approach us on this is to present the problem, describe what you've done to solve it, and ask why you're not getting the results you expect. Then you'll probably get some help. But to post like you're simply looking for a place to cut and paste your homework won't fly. We get plenty of queries like that and they're generally all told to take a hike, some less politely than others. One potential problem with the method you sketched is that the lines you get after you run the Sobel and threshold is they may contain gaps for one reason or another. You may need a way to look at the partial lines and fill in the blanks. Since the problem is fairly artificial, you have a lot of prior knowledge about what you're looking for.

                2 75 22 6

                P 1 Reply Last reply
                0
                • A asiv

                  Hi everyone, I have a small question, for my school project i need to make a program for counting brick in image. So I have a picture with nothing but bricks on it, and i need to count them, the idea i have is to use Sobel algorithm, blur, binaryzation and region search, something like that. Is is the right way to go, or is there any better one? Thank you all for your help!

                  A Offline
                  A Offline
                  asiv
                  wrote on last edited by
                  #8

                  Well project done...basically I managed to get all algorithems done, except region search, but well in the end I used AForge .NET Framework and got the job done in the fraction of time. Thank you all for your help and assistance.

                  1 Reply Last reply
                  0
                  • T Tim Craig

                    Yes, to echo what Mark said. The way to approach us on this is to present the problem, describe what you've done to solve it, and ask why you're not getting the results you expect. Then you'll probably get some help. But to post like you're simply looking for a place to cut and paste your homework won't fly. We get plenty of queries like that and they're generally all told to take a hike, some less politely than others. One potential problem with the method you sketched is that the lines you get after you run the Sobel and threshold is they may contain gaps for one reason or another. You may need a way to look at the partial lines and fill in the blanks. Since the problem is fairly artificial, you have a lot of prior knowledge about what you're looking for.

                    2 75 22 6

                    P Offline
                    P Offline
                    Paul Conrad
                    wrote on last edited by
                    #9

                    Tim Craig wrote:

                    to post like you're simply looking for a place to cut and paste your homework won't fly

                    I ditto that Tim. I was going to give some input, but not now :rolleyes:

                    "The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon

                    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