Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 7 of 7

Thread: global color histogram

  1. #1
    Junior Member
    Join Date
    Oct 2012
    Posts
    12
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default global color histogram

    hey
    i can't understand this line,plz tell me what is the meaning of 64 color value and on which base it classify/covert RGB in 0 t0 63 integer??
    "the global color histogram, method returns 64 color values represent the probability of pixels in the sample image of a particular color."

    below the line code return integer values from 0 to 63 for any RGB value . image.getRGB(x,y) return RGB value of pixel at x,y position.
    (image.getRGB(x,y)>>18 & 0x30) | (image.getRGB(x,y)>>12 & 0xc) | (image.getRGB(x,y)>>6 & 0x3)


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,166
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: global color histogram

    The formula at the bottom of your post builds a 6 bit number from the value returned by getRGB() method.
    2^6 is 64
    If you OR together the & bit values you should get: 0b111111 from: 0x30 | 0x0c | 0x03
    If you don't understand my answer, don't ignore it, ask a question.

  3. The Following User Says Thank You to Norm For This Useful Post:

    larbie (February 28th, 2013)

  4. #3
    Junior Member
    Join Date
    Oct 2012
    Posts
    12
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: global color histogram

    but on which base ,for different RGB value it return same integer y??

  5. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,166
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: global color histogram

    but on which base ,for different RGB value it return same integer y?
    Yes it will return the same value for many colors. That is what the histogram is for. To display the number of different colors that had the same value in the 0-63 range produced by the formula.
    If you don't understand my answer, don't ignore it, ask a question.

  6. The Following User Says Thank You to Norm For This Useful Post:

    larbie (February 28th, 2013)

  7. #5
    Junior Member
    Join Date
    Oct 2012
    Posts
    12
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: global color histogram

    okk i got it.will it reduce the quality of image color or the accuracy of histogram??
    if i use this same technique for 8 bit 0-255,because java use 8 bit to represent color code like
    (image.getRGB(x,y)>> 16 & 0xff) | (image.getRGB(x,y) >> 8 & 0xff) | (image.getRGB(x,y)& 0xff)
    which is better ,6 bit or 8 bit ??

  8. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,166
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: global color histogram

    will it reduce the quality of image color or the accuracy of histogram??
    I don't know how it effects the colors. The histogram counts what it is supposed to count. Whoever devised the bit sampling technique should be asked what the histogram is suppose to be counting.
    If you don't understand my answer, don't ignore it, ask a question.

  9. #7
    Junior Member
    Join Date
    Oct 2012
    Posts
    12
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: global color histogram

    thanks for your time

Similar Threads

  1. Why does the Color class have two variables for each color?
    By Melawe in forum Java Theory & Questions
    Replies: 5
    Last Post: May 10th, 2012, 04:21 PM
  2. How can I create a global or local script terminater?
    By YourCrazyFriend in forum Java Theory & Questions
    Replies: 5
    Last Post: March 20th, 2012, 06:33 AM
  3. [SOLVED] Printing A Histogram...
    By Nuggets in forum What's Wrong With My Code?
    Replies: 9
    Last Post: March 18th, 2012, 02:11 PM
  4. text color changer based on words/ word classification by color
    By knoxy5467 in forum Java Theory & Questions
    Replies: 25
    Last Post: June 15th, 2011, 07:52 AM
  5. [SOLVED] Problem while getting a number from another thread
    By Koren3 in forum Threads
    Replies: 4
    Last Post: April 7th, 2009, 01:42 PM