Skip to content

Commit

Permalink
traitement image V2
Browse files Browse the repository at this point in the history
  • Loading branch information
Ibou42 committed May 7, 2023
0 parents commit 84b9c9b
Show file tree
Hide file tree
Showing 144 changed files with 1,498 additions and 0 deletions.
Binary file added .DS_Store
Binary file not shown.
Binary file added Activity/.DS_Store
Binary file not shown.
Binary file added Activity/PriseEnMainActivite0/.DS_Store
Binary file not shown.
8 changes: 8 additions & 0 deletions Activity/PriseEnMainActivite0/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="lib" path="C:/Users/Public/Documents/TPPanneaux/Candidat1/PriseEnMainActivite0/Mabiblio.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/OpenCV"/>
<classpathentry kind="output" path="bin"/>
</classpath>
28 changes: 28 additions & 0 deletions Activity/PriseEnMainActivite0/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>PriseEnMainActivite0</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<filteredResources>
<filter>
<id>1683024126025</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
11 changes: 11 additions & 0 deletions Activity/PriseEnMainActivite0/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
Binary file added Activity/PriseEnMainActivite0/Mabiblio.jar
Binary file not shown.
Binary file added Activity/PriseEnMainActivite0/Thumbs.db
Binary file not shown.
Binary file added Activity/PriseEnMainActivite0/bin/Activite0.class
Binary file not shown.
Binary file added Activity/PriseEnMainActivite0/bin/Thumbs.db
Binary file not shown.
Binary file added Activity/PriseEnMainActivite0/ref110.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Activity/PriseEnMainActivite0/ref30.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Activity/PriseEnMainActivite0/ref50.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Activity/PriseEnMainActivite0/ref70.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Activity/PriseEnMainActivite0/ref90.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Activity/PriseEnMainActivite0/refdouble.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions Activity/PriseEnMainActivite0/src/Activite0.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import utilitaireAgreg.*;

public class Activite0 {


public static void main(String[] args) {
MaBibliothequeTraitementImage.ObjectifARealiser("video1.avi");
}
}
Binary file added Activity/PriseEnMainActivite0/src/Thumbs.db
Binary file not shown.
Binary file added Activity/PriseEnMainActivite0/video1.avi
Binary file not shown.
Binary file added Activity/PriseEnMainActivite0/video1.mp4
Binary file not shown.
Binary file added Activity/PriseEnMainActivite0/video2.avi
Binary file not shown.
Binary file added Activity/PriseEnMainActivite0/video2.mp4
Binary file not shown.
Binary file added Activity/PriseEnMainActivite1/.DS_Store
Binary file not shown.
7 changes: 7 additions & 0 deletions Activity/PriseEnMainActivite1/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/OpenCV"/>
<classpathentry kind="output" path="bin"/>
</classpath>
28 changes: 28 additions & 0 deletions Activity/PriseEnMainActivite1/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>PriseEnMainActivite1</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<filteredResources>
<filter>
<id>1683024126038</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
11 changes: 11 additions & 0 deletions Activity/PriseEnMainActivite1/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
Binary file added Activity/PriseEnMainActivite1/Thumbs.db
Binary file not shown.
Binary file added Activity/PriseEnMainActivite1/activite1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Activity/PriseEnMainActivite1/bin/Activite1.class
Binary file not shown.
41 changes: 41 additions & 0 deletions Activity/PriseEnMainActivite1/src/Activite1.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import java.io.File;

import org.opencv.core.Mat;
import org.opencv.highgui.Highgui;

public class Activite1 {

public static void main(String[] args) {
//Chargement de la librairie
System.loadLibrary("opencv_java249");
//Lecture du fichier image et transformation en matrice
Mat m=LectureImage("activite1.png");

//Début du traitement
for (int i=0; i<m.height();i++){
for(int j=0;j<m.width();j++){
double[] BGR=m.get(i, j);
//si c'est un point blanc....
if(BGR[0]==255 && BGR[1]==255 && BGR[2]==255){
//affiche un point dans la console sans retour à la ligne
System.out.print(".");}
else{//sinon...
//affiche un + dans la console
System.out.print("+");
}
}
//N'affiche rien mais execute un retour à la ligne
System.out.println();
}

}
//Methode qui ouvre un fichier et renvoie la matrice au format OpenCV
public static Mat LectureImage(String fichier){
File f=new File(fichier);
Mat m=Highgui.imread(f.getAbsolutePath());
return m;

}


}
Binary file added Activity/PriseEnMainActivite2/.DS_Store
Binary file not shown.
8 changes: 8 additions & 0 deletions Activity/PriseEnMainActivite2/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="lib" path="C:/Users/Public/Documents/TPPanneaux/Candidat1/DeuxièmeEtude/Mabiblio.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/OpenCV"/>
<classpathentry kind="output" path="bin"/>
</classpath>
28 changes: 28 additions & 0 deletions Activity/PriseEnMainActivite2/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>PriseEnMainActivite2</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<filteredResources>
<filter>
<id>1683024126053</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
11 changes: 11 additions & 0 deletions Activity/PriseEnMainActivite2/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
Binary file added Activity/PriseEnMainActivite2/Thumbs.db
Binary file not shown.
Binary file added Activity/PriseEnMainActivite2/bgr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Activity/PriseEnMainActivite2/bin/Activite2.class
Binary file not shown.
64 changes: 64 additions & 0 deletions Activity/PriseEnMainActivite2/src/Activite2.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.InputStream;
import java.util.Vector;

import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;

import org.opencv.core.Core;
import org.opencv.core.Mat;
import org.opencv.core.MatOfByte;
import org.opencv.highgui.Highgui;

public class Activite2 {

public static void main(String[] args) {
// TODO Auto-generated method stubCE
System.loadLibrary("opencv_java249");
//Lecture du fichier image et transformation en matrice
Mat m=LectureImage("bgr.png");
//Création d'un vecteur de matrices
Vector<Mat> channels=new Vector<Mat>();
//découpage de la matrice en 3 canneaux séparés
Core.split(m,channels);
for (int i=0;i<channels.size();i++){
afficheImage("Voie n°"+Integer.toString(i),channels.get(i));
}
}


//Methode qui ouvre un fichier et renvoie la matrice au format OpenCV (la meme que dans l'activite 0)
public static Mat LectureImage(String fichier){
File f=new File(fichier);
Mat m=Highgui.imread(f.getAbsolutePath());
return m;

}
//Methode qui affiche une matrice dans une fenetre Java (inutile d'analyser ce code dans le cadre de cette épreuve)
public static void afficheImage(String title, Mat img){
MatOfByte matOfByte=new MatOfByte();
Highgui.imencode(".png",img,matOfByte);
byte[] byteArray=matOfByte.toArray();
BufferedImage bufImage=null;
try{
InputStream in=new ByteArrayInputStream(byteArray);
bufImage=ImageIO.read(in);
JFrame frame=new JFrame();
frame.setTitle(title);
frame.getContentPane().add(new JLabel(new ImageIcon(bufImage)));
frame.pack();
frame.setVisible(true);

}
catch(Exception e){
e.printStackTrace();
}


}

}
Binary file added Activity/PriseEnMainActivite3/.DS_Store
Binary file not shown.
8 changes: 8 additions & 0 deletions Activity/PriseEnMainActivite3/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/OpenCV"/>
<classpathentry kind="lib" path="C:/Users/Public/Documents/TPPanneaux/Candidat1/DeuxièmeEtude/Mabiblio.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
28 changes: 28 additions & 0 deletions Activity/PriseEnMainActivite3/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>PriseEnMainActivite3</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<filteredResources>
<filter>
<id>1683024126069</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
11 changes: 11 additions & 0 deletions Activity/PriseEnMainActivite3/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
Binary file added Activity/PriseEnMainActivite3/bin/Activite3.class
Binary file not shown.
Binary file not shown.
Binary file added Activity/PriseEnMainActivite3/p0.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions Activity/PriseEnMainActivite3/src/Activite3.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

import org.opencv.core.*;
import org.opencv.highgui.*;

public class Activite3 {

public static void main(String[] args)
{
System.loadLibrary("opencv_java249");
Mat m=Highgui.imread("p0.jpg",Highgui.CV_LOAD_IMAGE_COLOR);
MaBibliothequeTraitementImage.afficheImage("Image originale", m);


}
}
Loading

0 comments on commit 84b9c9b

Please sign in to comment.