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. C#
  4. how to vertically scan an image in c#

how to vertically scan an image in c#

Scheduled Pinned Locked Moved C#
csharphelptutorialquestionlearning
9 Posts 3 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.
  • S Offline
    S Offline
    Swati Khanna
    wrote on last edited by
    #1

    how do i scan an image column wise in c# . i need help with the code . i wanted to read the next pixel of the same column .please help im a beginner in image processing Thanks in advance

    M 1 Reply Last reply
    0
    • S Swati Khanna

      how do i scan an image column wise in c# . i need help with the code . i wanted to read the next pixel of the same column .please help im a beginner in image processing Thanks in advance

      M Offline
      M Offline
      musefan
      wrote on last edited by
      #2

      well if your image is a bitmap you can create a 2D array of pixels then loop through columns and rows actually just use:

      Bitmap b = new Bitmap(filepath);

      for(int i = 0; i < b.Width; i++)//Columns
      {
      for(int j = 0; j < b.Height; j++)//Rows
      {
      Color c = b.GetPixel(i, j);
      //or do what ever you want with the pixel
      }
      }

      S 1 Reply Last reply
      0
      • M musefan

        well if your image is a bitmap you can create a 2D array of pixels then loop through columns and rows actually just use:

        Bitmap b = new Bitmap(filepath);

        for(int i = 0; i < b.Width; i++)//Columns
        {
        for(int j = 0; j < b.Height; j++)//Rows
        {
        Color c = b.GetPixel(i, j);
        //or do what ever you want with the pixel
        }
        }

        S Offline
        S Offline
        Swati Khanna
        wrote on last edited by
        #3

        do u mean i can use getpixel and setpixel method to solve this....i was intending to use unsafe code so that it could be faster....

        M 1 Reply Last reply
        0
        • S Swati Khanna

          do u mean i can use getpixel and setpixel method to solve this....i was intending to use unsafe code so that it could be faster....

          M Offline
          M Offline
          musefan
          wrote on last edited by
          #4

          what do you want to do with the pixels?

          S 1 Reply Last reply
          0
          • M musefan

            what do you want to do with the pixels?

            S Offline
            S Offline
            Swati Khanna
            wrote on last edited by
            #5

            i am trying to segment characters from a string of characters in a license plate image....i want to scan my image column wise so that i can extract every character ....so i need to find how many black pixels are present in a column....

            M 1 Reply Last reply
            0
            • S Swati Khanna

              i am trying to segment characters from a string of characters in a license plate image....i want to scan my image column wise so that i can extract every character ....so i need to find how many black pixels are present in a column....

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

              Good luck lol :P You do have to go through the pixels though, so I would stay with my GetPixel() suggestion. I dont know of another alternative to getting the pixels sorry :( (unless you read the file yourself, but then you would have to store pixels as an array, and loop through them yourself) Just out of interest - what algorithms will you be using to detect the letters?

              L 1 Reply Last reply
              0
              • M musefan

                Good luck lol :P You do have to go through the pixels though, so I would stay with my GetPixel() suggestion. I dont know of another alternative to getting the pixels sorry :( (unless you read the file yourself, but then you would have to store pixels as an array, and loop through them yourself) Just out of interest - what algorithms will you be using to detect the letters?

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

                There's some articles on CP that deal with OCR. Would still be a challenge, I guess :)

                I are troll :)

                M 1 Reply Last reply
                0
                • L Lost User

                  There's some articles on CP that deal with OCR. Would still be a challenge, I guess :)

                  I are troll :)

                  M Offline
                  M Offline
                  musefan
                  wrote on last edited by
                  #8

                  ahhh.. V.Interesting. Might take a look at doing something like that if i ever get the free time lol The office MODI method looks like the simplist approach, cant say that be good for speed thou :P

                  S 1 Reply Last reply
                  0
                  • M musefan

                    ahhh.. V.Interesting. Might take a look at doing something like that if i ever get the free time lol The office MODI method looks like the simplist approach, cant say that be good for speed thou :P

                    S Offline
                    S Offline
                    Swati Khanna
                    wrote on last edited by
                    #9

                    thanku all ........if any 1 can still help i'll be highly obliged..........

                    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