root / org.gvsig.toolbox / trunk / org.gvsig.toolbox / org.gvsig.toolbox.algorithm / src / main / java / es / unex / sextante / imageAnalysis / texture / features / TextureEntropyAlgorithm.java @ 59
History | View | Annotate | Download (779 Bytes)
1 | 59 | nbrodin | package es.unex.sextante.imageAnalysis.texture.features; |
---|---|---|---|
2 | |||
3 | import es.unex.sextante.core.Sextante; |
||
4 | import es.unex.sextante.imageAnalysis.texture.base.BaseTextureAnalysisAlgorithm; |
||
5 | |||
6 | public class TextureEntropyAlgorithm |
||
7 | extends
|
||
8 | BaseTextureAnalysisAlgorithm { |
||
9 | |||
10 | @Override
|
||
11 | public void defineCharacteristics() { |
||
12 | |||
13 | super.defineCharacteristics();
|
||
14 | |||
15 | this.setName(Sextante.getText("Texture_Entropy")); |
||
16 | |||
17 | } |
||
18 | |||
19 | |||
20 | @Override
|
||
21 | protected double getTextureFeature() { |
||
22 | |||
23 | double dEntropy = 0; |
||
24 | for (int i = 0; i < GRAYSCALE_LEVELS; i++) { |
||
25 | for (int j = 0; j < GRAYSCALE_LEVELS; j++) { |
||
26 | dEntropy += (m_GLCM[i][j] * -1 * Math.log(m_GLCM[i][j])); |
||
27 | } |
||
28 | } |
||
29 | |||
30 | return dEntropy;
|
||
31 | |||
32 | } |
||
33 | |||
34 | } |