|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object integralhistogram.Histogram
public class Histogram
this class implements the Hist interfeace, you can use this class to manage color histograms.
Constructor Summary | |
---|---|
Histogram(int bitPerComp)
class constructor. |
Method Summary | |
---|---|
void |
copy(Hist srcHist)
copy source histogram's bins onto the current histogram. |
void |
createFromImage(int imgWidth,
int imgHeight,
int[] imgPixels)
use the current histogram ("this" operator) to store the (color) histogram of a source image. |
int |
getBinsPerComp()
return the the number of bit per component (usually choosed by the user trought the implementation class's constructor) |
int |
getBinValue(int bin)
return the content of the queried bin |
void |
normalize(float[] outputHist,
int norm)
normalize the current histogram and store the output in outputHist. |
void |
sumHists(Hist leftHist,
Hist upHist,
Hist up_leftHist,
int currentPixel)
compute an wavefront propagation step. |
void |
sumPixel(int pixelColor)
update the histogram adding the pixelColor value in the right bin |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Histogram(int bitPerComp)
bitPerComp
- number of bit per color (RGB) mode
e.g.: bitPerComp = 2 mean you choosed 6 bits per pixel, that is: four possible values for each component,
otherwise bitPerComp = 4 means you choosed 12 bit per pixel (16 possible values for each component).
(be carefull, a 4 bit per component choose, for a source image source size of 300x300 pixels will ask you
more than 1 GB of ram for the integral histogram's propagation method).
usually you can achive your scope with: bitPerComp = 2.Method Detail |
---|
public int getBinValue(int bin)
Hist
getBinValue
in interface Hist
bin
-
public int getBinsPerComp()
Hist
getBinsPerComp
in interface Hist
public void copy(Hist srcHist)
copy
in interface Hist
srcHist
- source histogrampublic void sumPixel(int pixelColor)
sumPixel
in interface Hist
pixelColor
- public void sumHists(Hist leftHist, Hist upHist, Hist up_leftHist, int currentPixel)
sumHists
in interface Hist
leftHist,upHist,up_LeftHist
- source histograms used for propagation stepcurrentPixel
- source image's pixel of the current pointpublic void normalize(float[] outputHist, int norm)
normalize
in interface Hist
outputHist
- normalization's outputnorm
- normalize factorpublic void createFromImage(int imgWidth, int imgHeight, int[] imgPixels)
createFromImage
in interface Hist
imgWidth
- imgHeight
- imgPixels
- the pixels's array of the source image
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |