|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.hd.d.pg2k.ai.scorer.AbstractScorer
org.hd.d.pg2k.ai.scorer.AbstractImgScorer
org.hd.d.pg2k.ai.scorer.AbstractImgSampleScorer
org.hd.d.pg2k.ai.scorer.parameterised.SimpleHue
public final class SimpleHue
Simple score/measure of presence of various key 'hues' in an image; never null. This scores an image highly if a suitable fraction (in a specified range) of sampled pixels is within one of a number of acceptable (wrapped) hue ranges (centre hue and tolerance) in an HSB (Hue, Saturation, Brightness) colour model.
The aim is to be able (for example) to give an image a good score if it contains a reasonable fraction of sky (blue) or skin (tone) or green (grass and trees).
The set of sample points is a grid spaced in a regular (though not a simple grid) pattern across the image. The layout of the sample points depends on the image size and aspect ratio, and is generated from a pseudo-random generator, to help avoid poor sampling of images with regular patterns in them.
Very small images will have all their pixels sampled, and so can in principle still achieve a MAX confidence.
Parameters include:
This scoring method should run in constant time regardless of image size since it samples at most a fixed ceiling number of image points.
We may reject samples that are:
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.hd.d.pg2k.ai.scorer.AbstractImgScorer |
|---|
AbstractImgScorer.ARGBPixelFilter |
| Field Summary | |
|---|---|
private ScorerParamInteger |
sampleSizeParam
Target sample size for this instance; never null. |
private static ScorerParamInteger |
sampleSizeParamBounds
Min, default and max shift (power-of-two) for the target sample size; never null. |
| Fields inherited from class org.hd.d.pg2k.ai.scorer.AbstractImgSampleScorer |
|---|
MAX_SAMPLE_SIZE_POWER |
| Fields inherited from class org.hd.d.pg2k.ai.scorer.AbstractImgScorer |
|---|
rejectMainlyTransparentPoints |
| Fields inherited from class org.hd.d.pg2k.ai.scorer.AbstractScorer |
|---|
nameAndParameters, parameterNameRegex, parameterSepRegex, scorerNameRegex, SEPARATOR |
| Constructor Summary | |
|---|---|
SimpleHue()
Create simple non-parameterised instance. |
|
SimpleHue(java.lang.String nameAndParameters)
Create parameterised version. |
|
SimpleHue(java.lang.String baseName,
java.util.List<ScorerParam> parameters)
Create parameterised version. |
|
| Method Summary | |
|---|---|
ScoreAndConf |
computeScoreAndConfidenceOnStillImagePixelSamples(java.lang.Object key,
java.util.concurrent.Callable<ROIntArray> stillImagePixelSamplesFactory)
Score the image for "exposure"; never null nor negative in any component. |
ScorerIF |
createVariant(java.lang.String nameAndParameters)
Simple non-static factory for the parameterised case. |
ScorerIF |
createVariant(java.lang.String baseName,
java.util.List<ScorerParam> parameters)
Create variant of same base Scorer with base name and parameters; never null. |
java.util.List<ScorerParam> |
getParameterDefsAndValues()
Get parameter definitions and values (immutable) for this Scorer; never null. |
| Methods inherited from class org.hd.d.pg2k.ai.scorer.AbstractImgSampleScorer |
|---|
callStillImagePixelSamplesFactory, computeScoreAndConfidenceOnStillImage, getUnfilteredSamplePoints |
| Methods inherited from class org.hd.d.pg2k.ai.scorer.AbstractImgScorer |
|---|
callStillImageFactory, computeScoreAndConfidence, getSamplePoints |
| Methods inherited from class org.hd.d.pg2k.ai.scorer.AbstractScorer |
|---|
canonicalise, createPerturbedVariant, getBaseName, getDefaultName, getNameAndParameters, getPerturbedDefsAndValues, isValidParameterName, isValidScorerName, paramListAsMap, paramListAsString, parseNameAndParameters, similarNParams, verySimilar |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.hd.d.pg2k.ai.scorer.ScorerIF |
|---|
computeScoreAndConfidence, createPerturbedVariant, getBaseName, getNameAndParameters, getPerturbedDefsAndValues |
| Field Detail |
|---|
private static final ScorerParamInteger sampleSizeParamBounds
private final ScorerParamInteger sampleSizeParam
Reducing the sample size by a factor of x is assumed to increase the noise, and thus reduce the confidence, by a factor of sqrt(x).
Experience suggests that upwards of a thousand samples gives good consistency.
| Constructor Detail |
|---|
public SimpleHue()
public SimpleHue(java.lang.String nameAndParameters)
public SimpleHue(java.lang.String baseName,
java.util.List<ScorerParam> parameters)
| Method Detail |
|---|
public ScorerIF createVariant(java.lang.String nameAndParameters)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException - for unparsable or inappropriate input
public ScorerIF createVariant(java.lang.String baseName,
java.util.List<ScorerParam> parameters)
throws java.lang.IllegalArgumentException
ScorerIFMay be able to share some (immutable) state with the original instance, and the value returned is immutable and may not be new.
java.lang.IllegalArgumentException - for unparsable or inappropriate input
public ScoreAndConf computeScoreAndConfidenceOnStillImagePixelSamples(java.lang.Object key,
java.util.concurrent.Callable<ROIntArray> stillImagePixelSamplesFactory)
throws java.io.IOException
computeScoreAndConfidenceOnStillImagePixelSamples in class AbstractImgSampleScorerkey - unique key identifying image for cacheing intermediate results for example;
if null then this will not be cached
java.lang.IllegalArgumentException - for a null image factory
java.lang.IllegalStateException - for some problem retrieving the image
java.lang.IllegalArgumentException - for a null image factory
java.lang.IllegalStateException - for some problem retrieving the image
java.io.IOExceptionpublic java.util.List<ScorerParam> getParameterDefsAndValues()
getParameterDefsAndValues in interface ScorerIFgetParameterDefsAndValues in class AbstractScorer
|
DHD Multimedia Gallery V1.53.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||