diff --git a/NGCC/src/ocr/Copie.java b/NGCC/src/ocr/Copie.java new file mode 100644 index 0000000..56773a4 --- /dev/null +++ b/NGCC/src/ocr/Copie.java @@ -0,0 +1,8 @@ +package ocr; + +public class Copie { + + ImagesCopie base; + + +} diff --git a/NGCC/src/ocr/ImagesCopie.java b/NGCC/src/ocr/ImagesCopie.java new file mode 100644 index 0000000..261ef89 --- /dev/null +++ b/NGCC/src/ocr/ImagesCopie.java @@ -0,0 +1,23 @@ +package ocr; + +import java.awt.image.BufferedImage; +import java.util.Map; + +public abstract class ImagesCopie { + + private Map hMapImgs; + + + public ImagesCopie(BufferedImage imgOriginale) { + + hMapImgs = Rogneur.createHMapImgs(imgOriginale); + } + + public void applyOcrForEach() { + + for(String s : hMapImgs.keySet()) + { + hMapImgs.get(s).applyOcrImg(); + } + } +} diff --git a/NGCC/src/ocr/Img.java b/NGCC/src/ocr/Img.java new file mode 100644 index 0000000..3647c45 --- /dev/null +++ b/NGCC/src/ocr/Img.java @@ -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; + } + + + + +} diff --git a/NGCC/src/ocr/ImgNote.java b/NGCC/src/ocr/ImgNote.java new file mode 100644 index 0000000..d923d09 --- /dev/null +++ b/NGCC/src/ocr/ImgNote.java @@ -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()));; + } + +} diff --git a/NGCC/src/ocr/ImgNumEtu.java b/NGCC/src/ocr/ImgNumEtu.java new file mode 100644 index 0000000..04b63d2 --- /dev/null +++ b/NGCC/src/ocr/ImgNumEtu.java @@ -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()));; + } + +} \ No newline at end of file diff --git a/NGCC/src/ocr/Rogneur.java b/NGCC/src/ocr/Rogneur.java new file mode 100644 index 0000000..5bacf55 --- /dev/null +++ b/NGCC/src/ocr/Rogneur.java @@ -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 createHMapImgs(BufferedImage imgOriginale) { + + Map 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(); + } +}