integralhistogram
Class HistogramDistance

java.lang.Object
  extended by integralhistogram.HistogramDistance
All Implemented Interfaces:
HistDistance

public class HistogramDistance
extends java.lang.Object
implements HistDistance

this class implements HistDistance. You can use it via MyTargetUser and MyTargetUser2.

Author:
Giovanni Tarducci, Alessio Barducci

Constructor Summary
HistogramDistance(float[] targetImgNormHist)
          Set the local reference to the normalized histogram of the target image; used during the distance compute.
 
Method Summary
 float computeDistance(float intersection, int bin)
          called during the intersection process.
 void init()
          init the distance value
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HistogramDistance

public HistogramDistance(float[] targetImgNormHist)
Set the local reference to the normalized histogram of the target image; used during the distance compute.

Parameters:
targetImgNormHist - target image's normalized histogram
Method Detail

computeDistance

public float computeDistance(float intersection,
                             int bin)
called during the intersection process. Our distance compute is based on the difference between the target region's bin and the normalized target histogram's bin.

Specified by:
computeDistance in interface HistDistance
Parameters:
intersection - current intersection value
bin - current bin
Returns:
float return the updated distance value

init

public void init()
init the distance value

Specified by:
init in interface HistDistance


processing library integralhistogram by Giovanni Tarducci, Alessio Barducci. (c) 2009