public class LocalExtremumBufferDouble extends Object implements LocalExtremum
Computes the maximum in a local buffer around current point.
This implementation considers a circular buffer (when a value is added, it replaces the first value that was inserted) that makes it possible to update extremum if needed.
LocalExtremum.Type
Constructor and Description |
---|
LocalExtremumBufferDouble(int n)
Main constructor.
|
LocalExtremumBufferDouble(int n,
double value)
Initializes an histogram filled with the given value.
|
LocalExtremumBufferDouble(int n,
LocalExtremum.Type type)
Constructor from size and type of extremum (minimum or maximum).
|
Modifier and Type | Method and Description |
---|---|
void |
add(double value)
Adds a value to the local histogram, and update bounds if needed.
|
void |
clear()
Resets inner counts with default maximum values (+INFINITY for MAX,
-INFINITY for MIN)
|
void |
fill(double value)
Resets histogram by considering it is filled with the given value.
|
double |
getMax()
Returns the maximum value stored in this local histogram
|
void |
setMinMaxSign(int sign)
Changes the sign used for distinguishing minimum and maximum.
|
public LocalExtremumBufferDouble(int n)
n
- the size of the bufferpublic LocalExtremumBufferDouble(int n, LocalExtremum.Type type)
n
- the size of the buffertype
- the type of extremum (maximum or minimum)public LocalExtremumBufferDouble(int n, double value)
n
- the size of the buffervalue
- the initial value of all elements in bufferpublic void setMinMaxSign(int sign)
sign
- +1 for maximum, -1 for minimumpublic void add(double value)
value
- the value to addpublic void clear()
public void fill(double value)
value
- the new value of all elements in bufferpublic double getMax()
Copyright © 2014–2023 INRA-IJPB Modeling and Digital Imaging lab. All rights reserved.