-
Notifications
You must be signed in to change notification settings - Fork 5
/
Score.java
47 lines (40 loc) · 1.57 KB
/
Score.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package org.genericsystem.cv.model;
import org.genericsystem.api.core.annotations.Components;
import org.genericsystem.api.core.annotations.InstanceClass;
import org.genericsystem.api.core.annotations.SystemGeneric;
import org.genericsystem.api.core.annotations.constraints.PropertyConstraint;
import org.genericsystem.common.Generic;
import org.genericsystem.cv.model.ImgFilter.ImgFilterInstance;
import org.genericsystem.cv.model.ZoneGeneric.ZoneInstance;
import org.genericsystem.cv.model.Score.ScoreInstance;
/**
* This class stores the score of a given couple of {@link ZoneGeneric} and
* {@link ImgFilter}
*
* When an image is processed, the score represents the probability for a given
* filter on a given zone to get an accurate text value after OCR.
*
* @author Jean Mathorel
* @author Pierrik Lassalas
*
*/
@SystemGeneric
@PropertyConstraint
@Components({ ZoneGeneric.class, ImgFilter.class })
@InstanceClass(ScoreInstance.class)
public class Score implements Generic {
public static class ScoreInstance implements Generic {
public ZoneInstance getZone() {
return (ZoneInstance) this.getComponent(0);
}
public ImgFilterInstance getImgFilter() {
return (ImgFilterInstance) this.getComponent(1);
}
}
public ScoreInstance setScore(Float score, ZoneInstance zoneInstance, ImgFilterInstance imgFilterInstance) {
return (ScoreInstance) setInstance(score, zoneInstance, imgFilterInstance);
}
public ScoreInstance getScore(ZoneInstance zoneInstance, ImgFilterInstance imgFilterInstance) {
return (ScoreInstance) getInstance(zoneInstance, imgFilterInstance);
}
}