adding new part ocr

This commit is contained in:
GrossPaul 2019-09-26 16:24:36 +02:00
parent 3eb6ddff90
commit 228c16c7fe
6 changed files with 148 additions and 0 deletions

8
NGCC/src/ocr/Copie.java Normal file
View File

@ -0,0 +1,8 @@
package ocr;
public class Copie {
ImagesCopie base;
}

View File

@ -0,0 +1,23 @@
package ocr;
import java.awt.image.BufferedImage;
import java.util.Map;
public abstract class ImagesCopie {
private Map<String,Img> hMapImgs;
public ImagesCopie(BufferedImage imgOriginale) {
hMapImgs = Rogneur.createHMapImgs(imgOriginale);
}
public void applyOcrForEach() {
for(String s : hMapImgs.keySet())
{
hMapImgs.get(s).applyOcrImg();
}
}
}

37
NGCC/src/ocr/Img.java Normal file
View File

@ -0,0 +1,37 @@
package ocr;
import java.awt.image.BufferedImage;
public abstract class Img {
BufferedImage img;
String description;
public Img(BufferedImage img) {
this.img = img;
}
public abstract void applyOcrImg();
public BufferedImage getImg() {
return img;
}
public void setImg(BufferedImage img) {
this.img = img;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}

19
NGCC/src/ocr/ImgNote.java Normal file
View File

@ -0,0 +1,19 @@
package ocr;
import java.awt.image.BufferedImage;
import ocr_orm.OCR;
public class ImgNote extends Img{
public ImgNote(BufferedImage img) {
super(img);
// TODO Auto-generated constructor stub
}
@Override
public void applyOcrImg() {
setDescription(OCR.applyOcrNumber(getImg()));;
}
}

View File

@ -0,0 +1,18 @@
package ocr;
import java.awt.image.BufferedImage;
import ocr_orm.OCR;
public class ImgNumEtu extends Img{
public ImgNumEtu(BufferedImage img) {
super(img);
}
@Override
public void applyOcrImg() {
setDescription(OCR.applyOcrNumber(getImg()));;
}
}

43
NGCC/src/ocr/Rogneur.java Normal file
View File

@ -0,0 +1,43 @@
package ocr;
import java.awt.image.BufferedImage;
import java.util.HashMap;
import java.util.Map;
public class Rogneur {
// Retourne une hashmap contenant une image et la description de son contenu
public static Map<String, Img> createHMapImgs(BufferedImage imgOriginale) {
Map<String,Img> temp = new HashMap<>();
temp.put("NumEtu", rogneurFormatNote(BufferedImage imgOriginale));
temp.put("Note", rogneurFormatNote(BufferedImage imgOriginale));
temp.put("FormatNote", rogneurFormatNote(BufferedImage imgOriginale));
return temp;
}
// rogne la partie du numEtu
public Img rogneurNumEtu(BufferedImage imgOriginale)
{
// A FAIRE
//return new ImgNum();
}
// rogne la partie de la note
public Img rogneurNote(BufferedImage imgOriginale)
{
// A FAIRE
//return new ImgNum();
}
// rogne la partie du format de la note
public Img rogneurFormatNote(BufferedImage imgOriginale)
{
// A FAIRE
//return new ImgNum();
}
}