wahid2006
Messages postés2Date d'inscriptionmardi 21 avril 2009StatutMembreDernière intervention 5 avril 2010
-
5 avril 2010 à 10:22
sa9rtounsi
Messages postés15Date d'inscriptionmardi 8 décembre 2009StatutMembreDernière intervention29 mars 2013
-
16 avril 2010 à 16:19
SVP Comment détecter un forme rectangle dans un image en java
JE besoin de code en java pour faire terminer le PFE.
TRÈS important svp
MERCI
sa9rtounsi
Messages postés15Date d'inscriptionmardi 8 décembre 2009StatutMembreDernière intervention29 mars 2013 16 avril 2010 à 16:19
essaye avec ce code,
cet un détection de visage,
il peut vous donne un bon ide,
et bon chance...package visualisationfiltre;
import utilitairesimage.*;
import utilitairesimage.*;
import utilitairesimage.FiltresArtistiques.*;
import utilitairesimage.FiltresConvolution.*;
import utilitairesimage.FiltresCouleurs.*;
import utilitairesimage.FiltresDeformations.*;
import utilitairesimage.FiltresGeometriques.*;
import javax.swing.UIManager;
public void setClip(int x, int y)
{
// keep clip within raster
int x0 = (getWidth() - size.width)/2;
int y0 = (getHeight() - size.height)/2;
if(x < x0 || x + clip.width > x0 + size.width ||
y < y0 || y + clip.height > y0 + size.height)
return;
clip.setLocation(x, y);
repaint();
}
public void setCli7(int x, int y)
{
// keep clip within raster
int x0 = (getWidth() - size.width)/2;
int y0 = (getHeight() - size.height)/2;
if(x < x0 || x + clip.width > x0 + size.width ||
y < y0 || y + clip.height > y0 + size.height)
return;
cli7.setLocation(x, y);
repaint();
}
public void setmmm(int x, int y)
{
// keep clip within raster
int x0 = (getWidth() - size.width)/2;
int y0 = (getHeight() - size.height)/2;
if(x < x0 || x + clip.width > x0 + size.width ||
y < y0 || y + clip.height > y0 + size.height)
return;
mmm.setLocation(x, y);
repaint();
}
public void setml(int x, int y)
{
// keep clip within raster
int x0 = (getWidth() - size.width)/2;
int y0 = (getHeight() - size.height)/2;
if(x < x0 || x + ml.width > x0 + size.width ||
y < y0 || y + ml.height > y0 + size.height)
return;
ml.setLocation(x, y);
repaint();
}
public Dimension getPreferredSize()
{
return size;
}
private void createClip()
{int a=130;int b=115;
/* String ch= t.getText();
int a=Integer.parseInt(ch);
String ch1= t1.getText();
int b=Integer.parseInt(ch1);
*/
clip = new Rectangle( a ,b);
clip.x = 173;
clip.y =123;
cli7 = new Rectangle(260 ,220);
cli7.x =0;
cli7.y =100;
mmm = new Rectangle(3,3);
mmm.x =0;
mmm.y =0;
ml= new Rectangle(3,3);
ml.x =0;
ml.y =20;
}
private void clipImage()
{
BufferedImage clipped = null;
BufferedImage clipp7= null;
try
{
int w = clip.width;
int h = clip.height;
int x0 = (getWidth() - size.width)/2;
int y0 = (getHeight() - size.height)/2;
int x = clip.x ;
int y = clip.y ;
clipped = image.getSubimage(x, y, w, h);
///////////////////
int w7 = cli7.width;
int h7 = cli7.height;
int x07 = (getWidth() - size.width)/2;
int y07 = (getHeight() - size.height)/2;
int x7 = cli7.x - x0;
int y7 = cli7.y - y0;
clipp7 = image.getSubimage(x7, y7, w7, h7);
/////////////////
int w1 = mmm.width;
int h1= mmm.height;
int x00 = (getWidth() - size.width)/2;
int y00 = (getHeight() - size.height)/2;
int x1 = mmm.x - x00;
int y1 = mmm.y - y00;
//////////////////////////////
int w11 = ml.width;
int h11= ml.height;
int x000 = (getWidth() - size.width)/2;
int y000 = (getHeight() - size.height)/2;
int x11 = ml.x;
int y11 = ml.y ;
/////////////
if(clip.x>8;
int b = (rgb & 0xff);
r = r+intensite+100;
g = g+intensite+100;
b = b+intensite+100;
if (r 255) r 255;
if (g 255) g 255;
if (b 255) b 255;
int newRGB = (0xff