Go to GoReading for breaking news, videos, and the latest top stories in world news, business, politics, health and pop culture.

How to Make a Histogram in Java

104 18
    • 1). Open the Java program and start a new project.

    • 2). Use the "PlanarImage" and "Create" functions to load an image on your hard drive into the new program's memory. Write out the code so the first line of the program reads something like "PlanarImage picturename JAI.create("fileload",picturename.Getabsolutepath())"

    • 3). Make a new array using double integers ranging from zero to 256. Define both the low end of the array and the high end of the array using brackets and a semicolon, just as you would when making any other array.

    • 4). Add the image into the array, then count through the lines of color in the image using the ".add" command.

    • 5). Use the "GetProperty" feature to produce a Histogram of the image. The code should read "op.Getproperty("histogram")"

    • 6). Execute the program to finish making the histogram.

Source...

Leave A Reply

Your email address will not be published.