Results 1 to 3 of 3
  1. #1
    desciomaryann is offline Member
    Join Date
    Feb 2013
    Posts
    1
    Rep Power
    0

    Default Counting Separate Black Pixel of two object in one image in java

    I am using a Binary buffered image with two objects in the image the 1cm square object (reference object) and the leaf and i wish to count and display the separate black pixels of the object and the leaf. If anyone could tell me how to implement this. It would be greatly appreciated...! Thank you :)

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is online now Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    4,038
    Rep Power
    10

    Default Re: Counting Separate Black Pixel of two object in one image in java

    Which part of this are you stuck on?
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    4,026
    Rep Power
    6

    Default Re: Counting Separate Black Pixel of two object in one image in java

    I have not done this myself but if you have a BufferedImage you could then use the getRGB(int x,int y) method and iterate over all pixels and compare the returned value to the desired color. However, this may not be very efficient. You may also want to investigate get getData() method which returns an image Raster which you could then analyze.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

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. Need Jar File!!!!! java.image.pixel ????
    By jspexception in forum New To Java
    Replies: 10
    Last Post: 03-15-2012, 07:11 PM
  3. Recognize Black Pixel of a Threshold Image
    By LankanSniper in forum Java 2D
    Replies: 1
    Last Post: 12-04-2009, 08:09 AM
  4. Replies: 14
    Last Post: 04-10-2009, 09:46 AM
  5. Why this image background is black ?
    By samson in forum Java 2D
    Replies: 1
    Last Post: 07-17-2007, 05:24 AM

Posting Permissions

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