Enum Class RankPrecision
- All Implemented Interfaces:
Serializable
,Comparable<RankPrecision>
,Constable
,CustomRankPrecision
Some predefined precision characteristics of rank operations, described in RankMorphology
interface.
Note: for every bit levels
array, represented by this enum,
there are both instances of this class with interpolated()
==falseinterpolated()
==true
This class is immutable and thread-safe: there are no ways to modify settings of the created instance.
- Author:
- Daniel Alievsky
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionHerebitLevels()
={1},interpolated()
=false.HerebitLevels()
={1},interpolated()
=true.HerebitLevels()
={10},interpolated()
=false.HerebitLevels()
={10},interpolated()
=true.HerebitLevels()
={5, 10},interpolated()
=false.HerebitLevels()
={5, 10},interpolated()
=true.HerebitLevels()
={11},interpolated()
=false.HerebitLevels()
={11},interpolated()
=true.HerebitLevels()
={5, 11},interpolated()
=false.HerebitLevels()
={5, 11},interpolated()
=true.HerebitLevels()
={12},interpolated()
=false.HerebitLevels()
={12},interpolated()
=true.HerebitLevels()
={4, 8, 12},interpolated()
=false.HerebitLevels()
={4, 8, 12},interpolated()
=true.HerebitLevels()
={6, 12},interpolated()
=false.HerebitLevels()
={6, 12},interpolated()
=true.HerebitLevels()
={13},interpolated()
=false.HerebitLevels()
={13},interpolated()
=true.HerebitLevels()
={6, 13},interpolated()
=false.HerebitLevels()
={6, 13},interpolated()
=true.HerebitLevels()
={14},interpolated()
=false.HerebitLevels()
={14},interpolated()
=true.HerebitLevels()
={7, 14},interpolated()
=false.HerebitLevels()
={7, 14},interpolated()
=true.HerebitLevels()
={15},interpolated()
=false.HerebitLevels()
={15},interpolated()
=true.HerebitLevels()
={5, 10, 15},interpolated()
=false.HerebitLevels()
={5, 10, 15},interpolated()
=true.HerebitLevels()
={7, 15},interpolated()
=false.HerebitLevels()
={7, 15},interpolated()
=true.HerebitLevels()
={16},interpolated()
=false.HerebitLevels()
={16},interpolated()
=true.HerebitLevels()
={5, 10, 16},interpolated()
=false.HerebitLevels()
={5, 10, 16},interpolated()
=true.HerebitLevels()
={8, 16},interpolated()
=false.HerebitLevels()
={8, 16},interpolated()
=true.HerebitLevels()
={2},interpolated()
=false.HerebitLevels()
={2},interpolated()
=true.HerebitLevels()
={20},interpolated()
=false.HerebitLevels()
={20},interpolated()
=true.HerebitLevels()
={10, 20},interpolated()
=false.HerebitLevels()
={10, 20},interpolated()
=true.HerebitLevels()
={5, 10, 15, 20},interpolated()
=false.HerebitLevels()
={5, 10, 15, 20},interpolated()
=true.HerebitLevels()
={6, 13, 20},interpolated()
=false.HerebitLevels()
={6, 13, 20},interpolated()
=true.HerebitLevels()
={22},interpolated()
=false.HerebitLevels()
={22},interpolated()
=true.HerebitLevels()
={11, 22},interpolated()
=false.HerebitLevels()
={11, 22},interpolated()
=true.HerebitLevels()
={5, 10, 15, 22},interpolated()
=false.HerebitLevels()
={5, 10, 15, 22},interpolated()
=true.HerebitLevels()
={7, 14, 22},interpolated()
=false.HerebitLevels()
={7, 14, 22},interpolated()
=true.HerebitLevels()
={24},interpolated()
=false.HerebitLevels()
={24},interpolated()
=true.HerebitLevels()
={12, 24},interpolated()
=false.HerebitLevels()
={12, 24},interpolated()
=true.HerebitLevels()
={4, 8, 12, 16, 20, 24},interpolated()
=false.HerebitLevels()
={4, 8, 12, 16, 20, 24},interpolated()
=true.HerebitLevels()
={6, 12, 18, 24},interpolated()
=false.HerebitLevels()
={6, 12, 18, 24},interpolated()
=true.HerebitLevels()
={8, 16, 24},interpolated()
=false.HerebitLevels()
={8, 16, 24},interpolated()
=true.HerebitLevels()
={26},interpolated()
=false.HerebitLevels()
={26},interpolated()
=true.HerebitLevels()
={13, 26},interpolated()
=false.HerebitLevels()
={13, 26},interpolated()
=true.HerebitLevels()
={6, 12, 18, 26},interpolated()
=false.HerebitLevels()
={6, 12, 18, 26},interpolated()
=true.HerebitLevels()
={8, 16, 26},interpolated()
=false.HerebitLevels()
={8, 16, 26},interpolated()
=true.HerebitLevels()
={3},interpolated()
=false.HerebitLevels()
={3},interpolated()
=true.HerebitLevels()
={4},interpolated()
=false.HerebitLevels()
={4},interpolated()
=true.HerebitLevels()
={5},interpolated()
=false.HerebitLevels()
={5},interpolated()
=true.HerebitLevels()
={6},interpolated()
=false.HerebitLevels()
={6},interpolated()
=true.HerebitLevels()
={7},interpolated()
=false.HerebitLevels()
={7},interpolated()
=true.HerebitLevels()
={8},interpolated()
=false.HerebitLevels()
={8},interpolated()
=true.HerebitLevels()
={4, 8},interpolated()
=false.HerebitLevels()
={4, 8},interpolated()
=true.HerebitLevels()
={9},interpolated()
=false.HerebitLevels()
={9},interpolated()
=true. -
Field Summary
Fields inherited from interface net.algart.matrices.morphology.CustomRankPrecision
MAX_NUMBER_OF_ANALYZED_BITS
-
Method Summary
Modifier and TypeMethodDescriptionint[]
The bit levels.boolean
Selects the histogram model used while calculating rank characteristics: true means the precise histogram model, false means the simple histogram model.int
Returns the last element of theCustomRankPrecision.bitLevels()
array.otherInterpolation
(boolean interpolated) Returns the enum instance with the samebit levels
and with the specified "interpolated
" flag.static RankPrecision
Returns the enum constant of this class with the specified name.static RankPrecision[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
BITS_1
HerebitLevels()
={1},interpolated()
=false. -
BITS_1_INTERPOLATED
HerebitLevels()
={1},interpolated()
=true. -
BITS_2
HerebitLevels()
={2},interpolated()
=false. -
BITS_2_INTERPOLATED
HerebitLevels()
={2},interpolated()
=true. -
BITS_3
HerebitLevels()
={3},interpolated()
=false. -
BITS_3_INTERPOLATED
HerebitLevels()
={3},interpolated()
=true. -
BITS_4
HerebitLevels()
={4},interpolated()
=false. -
BITS_4_INTERPOLATED
HerebitLevels()
={4},interpolated()
=true. -
BITS_5
HerebitLevels()
={5},interpolated()
=false. -
BITS_5_INTERPOLATED
HerebitLevels()
={5},interpolated()
=true. -
BITS_6
HerebitLevels()
={6},interpolated()
=false. -
BITS_6_INTERPOLATED
HerebitLevels()
={6},interpolated()
=true. -
BITS_7
HerebitLevels()
={7},interpolated()
=false. -
BITS_7_INTERPOLATED
HerebitLevels()
={7},interpolated()
=true. -
BITS_8
HerebitLevels()
={8},interpolated()
=false. -
BITS_8_INTERPOLATED
HerebitLevels()
={8},interpolated()
=true. -
BITS_8_PER_4
HerebitLevels()
={4, 8},interpolated()
=false. -
BITS_8_PER_4_INTERPOLATED
HerebitLevels()
={4, 8},interpolated()
=true. -
BITS_9
HerebitLevels()
={9},interpolated()
=false. -
BITS_9_INTERPOLATED
HerebitLevels()
={9},interpolated()
=true. -
BITS_10
HerebitLevels()
={10},interpolated()
=false. -
BITS_10_INTERPOLATED
HerebitLevels()
={10},interpolated()
=true. -
BITS_10_PER_5
HerebitLevels()
={5, 10},interpolated()
=false. -
BITS_10_PER_5_INTERPOLATED
HerebitLevels()
={5, 10},interpolated()
=true. -
BITS_11
HerebitLevels()
={11},interpolated()
=false. -
BITS_11_INTERPOLATED
HerebitLevels()
={11},interpolated()
=true. -
BITS_11_PER_5
HerebitLevels()
={5, 11},interpolated()
=false. -
BITS_11_PER_5_INTERPOLATED
HerebitLevels()
={5, 11},interpolated()
=true. -
BITS_12
HerebitLevels()
={12},interpolated()
=false. -
BITS_12_INTERPOLATED
HerebitLevels()
={12},interpolated()
=true. -
BITS_12_PER_6
HerebitLevels()
={6, 12},interpolated()
=false. -
BITS_12_PER_6_INTERPOLATED
HerebitLevels()
={6, 12},interpolated()
=true. -
BITS_12_PER_4
HerebitLevels()
={4, 8, 12},interpolated()
=false. -
BITS_12_PER_4_INTERPOLATED
HerebitLevels()
={4, 8, 12},interpolated()
=true. -
BITS_13
HerebitLevels()
={13},interpolated()
=false. -
BITS_13_INTERPOLATED
HerebitLevels()
={13},interpolated()
=true. -
BITS_13_PER_6
HerebitLevels()
={6, 13},interpolated()
=false. -
BITS_13_PER_6_INTERPOLATED
HerebitLevels()
={6, 13},interpolated()
=true. -
BITS_14
HerebitLevels()
={14},interpolated()
=false. -
BITS_14_INTERPOLATED
HerebitLevels()
={14},interpolated()
=true. -
BITS_14_PER_7
HerebitLevels()
={7, 14},interpolated()
=false. -
BITS_14_PER_7_INTERPOLATED
HerebitLevels()
={7, 14},interpolated()
=true. -
BITS_15
HerebitLevels()
={15},interpolated()
=false. -
BITS_15_INTERPOLATED
HerebitLevels()
={15},interpolated()
=true. -
BITS_15_PER_7
HerebitLevels()
={7, 15},interpolated()
=false. -
BITS_15_PER_7_INTERPOLATED
HerebitLevels()
={7, 15},interpolated()
=true. -
BITS_15_PER_5
HerebitLevels()
={5, 10, 15},interpolated()
=false. -
BITS_15_PER_5_INTERPOLATED
HerebitLevels()
={5, 10, 15},interpolated()
=true. -
BITS_16
HerebitLevels()
={16},interpolated()
=false. -
BITS_16_INTERPOLATED
HerebitLevels()
={16},interpolated()
=true. -
BITS_16_PER_8
HerebitLevels()
={8, 16},interpolated()
=false. -
BITS_16_PER_8_INTERPOLATED
HerebitLevels()
={8, 16},interpolated()
=true. -
BITS_16_PER_5
HerebitLevels()
={5, 10, 16},interpolated()
=false. -
BITS_16_PER_5_INTERPOLATED
HerebitLevels()
={5, 10, 16},interpolated()
=true. -
BITS_20
HerebitLevels()
={20},interpolated()
=false. -
BITS_20_INTERPOLATED
HerebitLevels()
={20},interpolated()
=true. -
BITS_20_PER_10
HerebitLevels()
={10, 20},interpolated()
=false. -
BITS_20_PER_10_INTERPOLATED
HerebitLevels()
={10, 20},interpolated()
=true. -
BITS_20_PER_7
HerebitLevels()
={6, 13, 20},interpolated()
=false. -
BITS_20_PER_7_INTERPOLATED
HerebitLevels()
={6, 13, 20},interpolated()
=true. -
BITS_20_PER_5
HerebitLevels()
={5, 10, 15, 20},interpolated()
=false. -
BITS_20_PER_5_INTERPOLATED
HerebitLevels()
={5, 10, 15, 20},interpolated()
=true. -
BITS_22
HerebitLevels()
={22},interpolated()
=false. -
BITS_22_INTERPOLATED
HerebitLevels()
={22},interpolated()
=true. -
BITS_22_PER_11
HerebitLevels()
={11, 22},interpolated()
=false. -
BITS_22_PER_11_INTERPOLATED
HerebitLevels()
={11, 22},interpolated()
=true. -
BITS_22_PER_7
HerebitLevels()
={7, 14, 22},interpolated()
=false. -
BITS_22_PER_7_INTERPOLATED
HerebitLevels()
={7, 14, 22},interpolated()
=true. -
BITS_22_PER_5
HerebitLevels()
={5, 10, 15, 22},interpolated()
=false. -
BITS_22_PER_5_INTERPOLATED
HerebitLevels()
={5, 10, 15, 22},interpolated()
=true. -
BITS_24
HerebitLevels()
={24},interpolated()
=false. -
BITS_24_INTERPOLATED
HerebitLevels()
={24},interpolated()
=true. -
BITS_24_PER_12
HerebitLevels()
={12, 24},interpolated()
=false. -
BITS_24_PER_12_INTERPOLATED
HerebitLevels()
={12, 24},interpolated()
=true. -
BITS_24_PER_8
HerebitLevels()
={8, 16, 24},interpolated()
=false. -
BITS_24_PER_8_INTERPOLATED
HerebitLevels()
={8, 16, 24},interpolated()
=true. -
BITS_24_PER_6
HerebitLevels()
={6, 12, 18, 24},interpolated()
=false. -
BITS_24_PER_6_INTERPOLATED
HerebitLevels()
={6, 12, 18, 24},interpolated()
=true. -
BITS_24_PER_4
HerebitLevels()
={4, 8, 12, 16, 20, 24},interpolated()
=false. -
BITS_24_PER_4_INTERPOLATED
HerebitLevels()
={4, 8, 12, 16, 20, 24},interpolated()
=true. -
BITS_26
HerebitLevels()
={26},interpolated()
=false. -
BITS_26_INTERPOLATED
HerebitLevels()
={26},interpolated()
=true. -
BITS_26_PER_13
HerebitLevels()
={13, 26},interpolated()
=false. -
BITS_26_PER_13_INTERPOLATED
HerebitLevels()
={13, 26},interpolated()
=true. -
BITS_26_PER_8
HerebitLevels()
={8, 16, 26},interpolated()
=false. -
BITS_26_PER_8_INTERPOLATED
HerebitLevels()
={8, 16, 26},interpolated()
=true. -
BITS_26_PER_6
HerebitLevels()
={6, 12, 18, 26},interpolated()
=false. -
BITS_26_PER_6_INTERPOLATED
HerebitLevels()
={6, 12, 18, 26},interpolated()
=true.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
bitLevels
public int[] bitLevels()Description copied from interface:CustomRankPrecision
The bit levels. (Here and below we shall designate this array as bitLevels.)The last element of this array bitLevels[bitLevels.length-1] is named the number of analysed bits and specifies the logarithm of the length of the histogram, used while calculating rank characteristics. More precisely, the length of the histogram is
M=2μ , whereμ = bitLevels[bitLevels.length-1] for floating-point matrix elements orμ = min(bitLevels[bitLevels.length-1], β) for fixed-point matrix elements,β = M. . See more details in comments toarray()
.bitsPerElement()
RankMorphology
interface, section 3.First bitLevels.length-1 elements of this array, i.e.
, are passed as bitLevelsOfPyramid argument ofJArrays.copyOfRange
(bitLevels,0,bitLevels.length-1)Histogram.newIntHistogram
orSummingHistogram.newSummingIntHistogram
methods, when they are called for creating objects, which really calculate the rank characteristics, described inRankMorphology
interface. In other words, first bitLevels.length-1 elements describe the levels of the pyramid of histograms: it is necessary for efficient processing large histograms, consisting of thousands or millions bars.This array must not be empty and must not contain more than 31 elements, and all its elements must be sorted in strictly increasing order:
bitLevels[k]<bitLevels[k+1] for all k. The elements of this array must not exceedCustomRankPrecision.MAX_NUMBER_OF_ANALYZED_BITS
limit.Below are possible examples of the array, returned by this method:
- {8} — the rank operations will be performed with a simple histogram, consisting of 256 bars; this precision is enough for byte matrices, but usually too low for short, int or floating-point matrices;
- {6, 12} — the rank operations will be performed with a two-level pyramid of histograms,
consisting of 4096 bars (or
min(4096,2β)=256 for byte matrices), which will be grouped by 64 bars into "wide" bars of the 2nd level; such a precision is enough for many application; - {8, 16, 24} — the rank operations will be performed with a three-level pyramid of histograms,
consisting of 224=16777216 bars (or
min(224,2β)=256 or 65636 for byte or short/char matrices), which will be grouped by 256 bars into "wide" bars of the 2nd level and by 65536 bars into "wide" bars of the 3rd levels; this precision is good for most applications; - {12, 24} — the rank operations will be performed with a two-level pyramid of histograms,
consisting of 224=16777216 bars (or
min(224,2β)=256 or 65636 for byte or short/char matrices), which will be grouped by 4096 bars into "wide" bars of the 2nd level; this precision is equivalent to the previous example, but usually provides better performance.
Note that the situation, when some or even all elements of this array are greater than 2β, is not an error — it just will lead to unjustified slowing down of calculations, because some levels of the pyramid of histograms will contain only 1 "wide" bar.
- Specified by:
bitLevels
in interfaceCustomRankPrecision
- Returns:
- bit levels of
the pyramid of histograms
(all elements excepting the last one) and the maximal possible total number of analyzed bitsμ=log2(histogram length) (the last element of this array). - See Also:
-
numberOfAnalyzedBits
public int numberOfAnalyzedBits()Description copied from interface:CustomRankPrecision
Returns the last element of theCustomRankPrecision.bitLevels()
array.- Specified by:
numberOfAnalyzedBits
in interfaceCustomRankPrecision
- Returns:
- the maximal possible total number of analyzed bits
μ=log2(histogram length) .
-
interpolated
public boolean interpolated()Description copied from interface:CustomRankPrecision
Selects the histogram model used while calculating rank characteristics: true means the precise histogram model, false means the simple histogram model. See comments toHistogram
andSummingHistogram
classes about these models.- Specified by:
interpolated
in interfaceCustomRankPrecision
- Returns:
- whether the rank operations should be performed in the precise histogram model.
-
otherInterpolation
Returns the enum instance with the samebit levels
and with the specified "interpolated
" flag.If the argument is equal to the current result of
interpolated()
method, returns the reference to this instance.- Parameters:
interpolated
- new "interpolated" flag.- Returns:
- the instance of this enum with the same
bit levels
and the specified "interpolated
" flag.
-