Results 1 to 3 of 3
  1. #1
    Maiquelnet is offline Member
    Join Date
    Nov 2009
    Rep Power

    Default Identify pixel in the image.

    I'm sorry my bad English. But I am Brazilian and I'm not accustomed to English.
    I have the following problem:
    I'm trying to identify a point (pixel) in an image.
    The problem is the following:
    Among some dashed lines need to identify where they intersect, or combine. The thickness of the line is 1 pixel. So by logic, where 1 pixel, find 3 neighboring pixels (connected) would be a point to identify. I need to do this to change the value of this pixel and its neighbors. The image is in grayscale. Black lines with
    Only those pixels that are neighbors are direct (online) (vertical, horizontal) and Diagonal.
    How could I do the reading of the image and find these points?
    I am using the class "raster" for reading.
    I do not know if I can do this by reading the linear rows and columns. Or if I use a neighborhood algorithm.
    How can I solve this problem?
    It has an example of an image: (link)

    Thank you all!

  2. #2
    mrmatt1111's Avatar
    mrmatt1111 is offline Senior Member
    Join Date
    Aug 2009
    San Jose, CA, USA
    Rep Power


    This is a hard problem, but very doable.

    Your first step is to decide what is a colored pixel. You will need to figure out the threshold of gray is considered a pixel: is it 90% black or 50% or some other percent black. It would be like:

    Java Code:
    public boolean isPixelBlack(int[] color) {...}


    Java Code:
    public boolean isPixelBlack(int indexedColor) {...}

    With that threshold method you can then loop through the image pixel array using the raster or a PixelGrabber and build a 2d boolean array and use it with your neighborhood algorithm.
    Last edited by mrmatt1111; 11-11-2009 at 09:54 PM.
    My Hobby Project: LegacyClone

  3. #3
    Maiquelnet is offline Member
    Join Date
    Nov 2009
    Rep Power

    Default Neighborhood algorithm?

    Thanks for the help mrmatt1111. But the fact is that the logic to find the pixels I know how. The problem is the algorithm of the neighborhood. That I do not know how. A given pixel would be easy to find.
    It would be 90% black, or greater, it is a point. Just do not know how the logic of the algorithm neighborhood. This one is my big question.
    Any ideas?

Similar Threads

  1. Scanning Image Pixel by Pixel
    By the_transltr in forum Advanced Java
    Replies: 5
    Last Post: 08-28-2012, 05:01 PM
  2. Reconstruct image from a pixel array
    By Sepho in forum New To Java
    Replies: 0
    Last Post: 08-29-2009, 01:27 AM
  3. Replies: 14
    Last Post: 04-10-2009, 09:46 AM
  4. how to get rgb value each pixel of an image file
    By tOpach in forum New To Java
    Replies: 1
    Last Post: 03-28-2009, 05:38 PM
  5. Replies: 1
    Last Post: 07-17-2007, 05:10 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts