Results 1 to 3 of 3
Thread: Identify pixel in the image.
- 11-11-2009, 05:31 PM #1
Member
- Join Date
- Nov 2009
- Posts
- 3
- Rep Power
- 0
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
background.
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)
uploads.javafree.com.br/files_user/files/5/52/91/pixels.jpg
Thank you all!
- 11-11-2009, 08:42 PM #2
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) {...}
-or-
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 08:54 PM.
My Hobby Project: LegacyClone
- 11-12-2009, 07:55 PM #3
Member
- Join Date
- Nov 2009
- Posts
- 3
- Rep Power
- 0
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
-
Scanning Image Pixel by Pixel
By the_transltr in forum Advanced JavaReplies: 5Last Post: 08-28-2012, 04:01 PM -
Reconstruct image from a pixel array
By Sepho in forum New To JavaReplies: 0Last Post: 08-29-2009, 12:27 AM -
[SOLVED] manipulating the pixel values of an image and constructinf a new image from
By sruthi_2009 in forum AWT / SwingReplies: 14Last Post: 04-10-2009, 08:46 AM -
how to get rgb value each pixel of an image file
By tOpach in forum New To JavaReplies: 1Last Post: 03-28-2009, 04:38 PM -
How can I get a transparent pixel from an image
By samson in forum Java 2DReplies: 1Last Post: 07-17-2007, 04:10 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks