najah01_3
Messages postés35Date d'inscriptiondimanche 24 septembre 2006StatutMembreDernière intervention17 juillet 2007
-
3 juin 2007 à 05:18
najah01_3
Messages postés35Date d'inscriptiondimanche 24 septembre 2006StatutMembreDernière intervention17 juillet 2007
-
7 juin 2007 à 00:59
salam ,
je ai realisé le programme de detections de contour d une image blan/noir . lors de l execution un message d ereur dans la partie "public inter filterRGB (int x, int y, int rgb) " s affiche . voici mon programme .
public class NegatifImage extends Applet
{
private Image image,
negatifImage;
public void init ()
{
// Création d'une image et de son négatif
image = getImage (getCodeBase (), "image1.jpg");
negatifImage = createImage (new FilteredImageSource
(image.getSource (),
new FiltreNegatif ()));
}
class FiltreNegatif extends RGBImageFilter
{
private int [] data ;
private int width ;
private int hight ;
public FiltreNegatif (Image Image) {
this.width = Image.getWidth ();
this.height = Image.getHeight ();
this.data = new int [this.width * this.height];
public class NegatifImage extends Applet {
private Image image,
negatifImage;
public void init() {
// Création d'une image et de son négatif
image = getImage(getCodeBase(), "image1.jpg");
negatifImage = createImage(new FilteredImageSource
(image.getSource(),
new FiltreNegatif (image)));
}
public void paint(Graphics gc) {
if (image != null) {
// Affichage des images
gc.drawImage(image, 0, 0, this);
gc.drawImage(negatifImage,
image.getWidth(this) + 10, 0, this);
}
}
}
class FiltreNegatif extends RGBImageFilter {
private int [] data ;
private int width ;
private int height ;
public FiltreNegatif(Image image) {
// POUR S'ASSURER QUE TOUTE L'IMAGE A ETAIT CHARGEE
// PAR LA SUITE DETERMINER SES DIMENSIONS
ImageIcon icon = new ImageIcon (image);
width = icon.getIconWidth();
height = icon.getIconHeight();
data = new int [width * height];