TRAITEMENT DE L'IMAGE : APPLICATION DE FILTRES (CMUGRAPHICS)

mogwai93 Messages postés 362 Date d'inscription mardi 31 décembre 2002 Statut Membre Dernière intervention 4 novembre 2023 - 23 févr. 2006 à 20:19
Pistol_Pete Messages postés 1053 Date d'inscription samedi 2 octobre 2004 Statut Membre Dernière intervention 9 juillet 2013 - 16 févr. 2012 à 17:55
Cette discussion concerne un article du site. Pour la consulter dans son contexte d'origine, cliquez sur le lien ci-dessous.

https://codes-sources.commentcamarche.net/source/36213-traitement-de-l-image-application-de-filtres-cmugraphics

Pistol_Pete Messages postés 1053 Date d'inscription samedi 2 octobre 2004 Statut Membre Dernière intervention 9 juillet 2013 7
16 févr. 2012 à 17:55
C'est un vieux programme qui a du mal à compiler maintenant. Je te conseil de regarder sur mon site internet :
http://ImAnalyse.free.fr

Quelques pistes :
stdlib -> stdlib.h
Les autres erreurs sont du type :
for(int i=0;i>n;i++)
{
to domething
}
i=5;

il faut mettre bien sur
int i
for(i=0;i>n;i++)
{
to domething
}
i=5;

et WIN_GRAY, ajoute un #define
Bonne continuation
A+
jonartoeli Messages postés 1 Date d'inscription jeudi 16 février 2012 Statut Membre Dernière intervention 16 février 2012
16 févr. 2012 à 17:46
Salut
j essaie de compiler sur DevC++ mais j ai des erreurs. Pouvez vous maidez
Merci

Compilateur: Default compiler
Building Makefile: "C:\Users\jjj\Desktop\filtre image\Makefile.win"
Exécution de make...
make.exe -f "C:\Users\Nold\Desktop\filtre image\Makefile.win" all
g++.exe -c paint.cpp -o paint.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include"

In file included from cmugraphics.h:16,
from paint.h:4,
from paint.cpp:1:
mousequeue.h:9:18: stdlib: No such file or directory
In file included from mousequeue.h:10,
from cmugraphics.h:16,
from paint.h:4,
from paint.cpp:1:
version.h:71:22: warning: no newline at end of file
In file included from cmugraphics.h:18,
from paint.h:4,
from paint.cpp:1:

image.h:82:18: warning: no newline at end of file
In file included from paint.h:4,
from paint.cpp:1:
cmugraphics.h:328:24: warning: no newline at end of file
In file included from paint.cpp:1:
paint.h:54:7: warning: no newline at end of file
paint.cpp: In constructor `paint::paint()':
paint.cpp:32: error: name lookup of `i' changed for new ISO `for' scoping
paint.cpp:22: error: using obsolete binding at `i'
paint.cpp:58: warning: converting to `int' from `double'
paint.cpp:59: warning: converting to `int' from `double'
paint.cpp:60: warning: converting to `int' from `double'
paint.cpp:67: error: `WIN_GRAY' undeclared (first use this function)
paint.cpp:67: error: (Each undeclared identifier is reported only once for each function it appears in.)
paint.cpp:72: warning: passing `double' for converting 3 of `void window::DrawRectangle(int, int, int, int, drawstyle, int, int)'

paint.cpp: In member function `int paint::median(int**, int, int)':
paint.cpp:139: error: name lookup of `k' changed for new ISO `for' scoping
paint.cpp:137: error: using obsolete binding at `k'

paint.cpp: In member function `void paint::passe_haut2()':
paint.cpp:223: error: name lookup of `i' changed for new ISO `for' scoping
paint.cpp:207: error: using obsolete binding at `i'

paint.cpp: In member function `void paint::contraste()':
paint.cpp:262: error: name lookup of `i' changed for new ISO `for' scoping
paint.cpp:245: error: using obsolete binding at `i'

paint.cpp: In member function `void paint::detection_bord()':
paint.cpp:302: error: name lookup of `i' changed for new ISO `for' scoping
paint.cpp:282: error: using obsolete binding at `i'

paint.cpp: In member function `void paint::phases()':
paint.cpp:368: error: name lookup of `i' changed for new ISO `for' scoping

paint.cpp:361: error: using obsolete binding at `i'

paint.cpp: In member function `void paint::repoussage()':
paint.cpp:395: error: name lookup of `i' changed for new ISO `for' scoping
paint.cpp:388: error: using obsolete binding at `i'

paint.cpp: In member function `void paint::echange(int, int)':

paint.cpp:435: error: name lookup of `k' changed for new ISO `for' scoping
paint.cpp:429: error: using obsolete binding at `k'

paint.cpp: In member function `void paint::noir_blanc()':
paint.cpp:477: warning: converting to `int' from `double'
paint.cpp:478: warning: converting to `int' from `double'
paint.cpp:479: warning: converting to `int' from `double'
paint.cpp:484: error: `WIN_GRAY' undeclared (first use this function)
paint.cpp:489: warning: passing `double' for converting 3 of `void window::DrawRectangle(int, int, int, int, drawstyle, int, int)'

paint.cpp: In member function `void paint::dessin_image()':
paint.cpp:575: warning: passing `double' for converting 1 of `color::color(unsigned char, unsigned char, unsigned char)'

paint.cpp:575: warning: passing `double' for converting 2 of `color::color(unsigned char, unsigned char, unsigned char)'
paint.cpp:575: warning: passing `double' for converting 3 of `color::color(unsigned char, unsigned char, unsigned char)'
paint.cpp:580: error: `WIN_GRAY' undeclared (first use this function)
paint.cpp:585: warning: passing `double' for converting 3 of `void window::DrawRectangle(int, int, int, int, drawstyle, int, int)'

paint.cpp: In function `void affiche(param*)':

paint.cpp:611: error: `WIN_GRAY' undeclared (first use this function)
paint.cpp: In function `void gestion_filtre(int, int, bool, param*)':
paint.cpp:668: error: name lookup of `i' changed for new ISO `for' scoping
paint.cpp:665: error: using obsolete binding at `i'

paint.cpp: In member function `void paint::DrawSpectre(window&)':
paint.cpp:808: error: name lookup of `i' changed for new ISO `for' scoping

paint.cpp:743: error: using obsolete binding at `i'
paint.cpp:811: warning: converting to `int' from `double'
paint.cpp:824: warning: passing `double' for converting 2 of `void window::DrawLine(int, int, int, int, drawstyle)'

make.exe: *** [paint.o] Error 1

Exécution terminée
cs_mzell Messages postés 2 Date d'inscription mardi 21 février 2006 Statut Membre Dernière intervention 29 novembre 2007
29 nov. 2007 à 22:19
Salut,

En fait, j'avais oublié d'ajouter le CMUgraphic...lib au projet. 9a marche maintenant.
Merci.
Pistol_Pete Messages postés 1053 Date d'inscription samedi 2 octobre 2004 Statut Membre Dernière intervention 9 juillet 2013 7
29 nov. 2007 à 12:30
Salut
Deux choses:
-Fait un nouveau programme avec seulement les lignes de codes tests de mon site. Dis moi si ca marche (l'ouverture de la fenetre graphique)
-As tu bien ajoutés tous les fichiers du projet: paint.h et paint.c ?
cs_mzell Messages postés 2 Date d'inscription mardi 21 février 2006 Statut Membre Dernière intervention 29 novembre 2007
27 nov. 2007 à 23:28
Bonjour,
J'ai bien ajouté la librairie comme indiquer sur votre site. Cependant je n'ai pas réussi à compiler votre projet!
Voici les erreurs, si vous pouviez me donner la cause, je vous remercie d'avance:

Linking...
main.obj : error LNK2001: unresolved external symbol "public: __thiscall window::~window(void)" (??1window@@QAE@XZ)
main.obj : error LNK2001: unresolved external symbol "public: void __thiscall paint::retour_save(struct param *)" (?retour_save@paint@@QAEXPAUparam@@@Z)
main.obj : error LNK2001: unresolved external symbol "public: void __thiscall paint::negatif(void)" (?negatif@paint@@QAEXXZ)
main.obj : error LNK2001: unresolved external symbol "public: void __thiscall paint::brouillage(void)" (?brouillage@paint@@QAEXXZ)
main.obj : error LNK2001: unresolved external symbol "public: void __thiscall paint::phases(void)" (?phases@paint@@QAEXXZ)
main.obj : error LNK2001: unresolved external symbol "public: void __thiscall paint::repoussage(void)" (?repoussage@paint@@QAEXXZ)
main.obj : error LNK2001: unresolved external symbol "public: void __thiscall paint::pastel_2(void)" (?pastel_2@paint@@QAEXXZ)
main.obj : error LNK2001: unresolved external symbol "public: void __thiscall paint::pastel_1(void)" (?pastel_1@paint@@QAEXXZ)
main.obj : error LNK2001: unresolved external symbol "public: void __thiscall paint::noir_blanc(void)" (?noir_blanc@paint@@QAEXXZ)
main.obj : error LNK2001: unresolved external symbol "public: void __thiscall paint::eclairage(int)" (?eclairage@paint@@QAEXH@Z)
main.obj : error LNK2001: unresolved external symbol "public: void __thiscall paint::desentrelassage(void)" (?desentrelassage@paint@@QAEXXZ)
main.obj : error LNK2001: unresolved external symbol "public: void __thiscall paint::detection_bord(void)" (?detection_bord@paint@@QAEXXZ)
main.obj : error LNK2001: unresolved external symbol "public: void __thiscall paint::contraste(void)" (?contraste@paint@@QAEXXZ)
main.obj : error LNK2001: unresolved external symbol "public: void __thiscall paint::passe_haut2(void)" (?passe_haut2@paint@@QAEXXZ)
main.obj : error LNK2001: unresolved external symbol "public: void __thiscall paint::passe_haut(void)" (?passe_haut@paint@@QAEXXZ)
main.obj : error LNK2001: unresolved external symbol "public: void __thiscall paint::passe_bas_median(void)" (?passe_bas_median@paint@@QAEXXZ)
main.obj : error LNK2001: unresolved external symbol "public: void __thiscall paint::flou_selectif(void)" (?flou_selectif@paint@@QAEXXZ)
main.obj : error LNK2001: unresolved external symbol "public: void __thiscall paint::dessin_image(void)" (?dessin_image@paint@@QAEXXZ)
main.obj : error LNK2001: unresolved external symbol "public: void __thiscall paint::passe_bas(void)" (?passe_bas@paint@@QAEXXZ)
main.obj : error LNK2001: unresolved external symbol "public: void __thiscall window::UpdateBuffer(void)" (?UpdateBuffer@window@@QAEXXZ)
main.obj : error LNK2001: unresolved external symbol "public: void __thiscall paint::DrawSpectre(class window &)" (?DrawSpectre@paint@@QAEXAAVwindow@@@Z)
main.obj : error LNK2001: unresolved external symbol "public: bool __thiscall window::SetBuffering(bool)" (?SetBuffering@window@@QAE_N_N@Z)
main.obj : error LNK2001: unresolved external symbol "public: __thiscall window::window(int,int,int,int)" (??0window@@QAE@HHHH@Z)
main.obj : error LNK2001: unresolved external symbol "public: __thiscall paint::paint(void)" (??0paint@@QAE@XZ)
main.obj : error LNK2001: unresolved external symbol "void __cdecl affiche(struct param *)" (?affiche@@YAXPAUparam@@@Z)
Debug/main.exe : fatal error LNK1120: 25 unresolved externals
Error executing link.exe.

main.exe - 26 error(s), 0 warning(s)
Pistol_Pete Messages postés 1053 Date d'inscription samedi 2 octobre 2004 Statut Membre Dernière intervention 9 juillet 2013 7
14 janv. 2007 à 19:56
Voila j'ai mis la lib sur mon site internet comme ca il ne devrait plus y avoir de problème et tout le monde pourra compiler mes sources
http://pistol.petesampras.free.fr

A+
Pistol_Pete Messages postés 1053 Date d'inscription samedi 2 octobre 2004 Statut Membre Dernière intervention 9 juillet 2013 7
11 oct. 2006 à 18:43
Ben je ne sais pas pourquoi ce lien ne marche plus, peut être que leur serveur est tombé...
Si tu veux récupérer la lib passe-moi ton adresse email et je te l'enverrais
hichamc75 Messages postés 2 Date d'inscription vendredi 8 avril 2005 Statut Membre Dernière intervention 10 octobre 2006
10 oct. 2006 à 16:57
j'ai un probléme avec l'adresse suivante http://cs.colgate.edu/APCS/C++/BorlandCMUInstall.html
j'aimerai récupérer la librairie
ptifleur Messages postés 36 Date d'inscription jeudi 2 mars 2006 Statut Membre Dernière intervention 16 mai 2006
23 mars 2006 à 15:11
Ton prog marche bien ,et il m'aidera par la suite .je te remercie
a+
Pistol_Pete Messages postés 1053 Date d'inscription samedi 2 octobre 2004 Statut Membre Dernière intervention 9 juillet 2013 7
22 mars 2006 à 20:16
Mon prog est en C++ donc tu devrais arriver a le compiler avec devc++. Vérifie que tu as bien inclue la librairi CMUgraphics lorsque tu as créé ton prog. Si ta bien suivit la demarche décrite sur le site internet que j'ai indiqué, il ne devrait pas avoir de pb. Sinon dis moi les messages d'erreur que tu as.
A+
ptifleur Messages postés 36 Date d'inscription jeudi 2 mars 2006 Statut Membre Dernière intervention 16 mai 2006
20 mars 2006 à 15:23
salut ,ton projet a t'il été fait avec DEVc++ ...parceque j'arrive pas à le compiler .
a+ merci d'avance
Pistol_Pete Messages postés 1053 Date d'inscription samedi 2 octobre 2004 Statut Membre Dernière intervention 9 juillet 2013 7
24 févr. 2006 à 15:14
Aussi je voulais vous demander: Pour le filtre repoussage et certaines couleurs le fitre fait baver l'image en vert en certain endroit. Je voulais savoir d'ou cela venait.
Mon filtre passe haut: contraste 1 me fait la meme chose lorsque on l'applique plusieurs fois de suite. Cepedant ici c'est normal puisque je convolue DIRECTEMENT les 2 matrices.(la valeur du pixel modifier a un role dans la valeur des autres pixels).Or j'utilise une image temporaire dans le filtre repoussage. Ce phénomène ne devrait plus exister.
Pistol_Pete Messages postés 1053 Date d'inscription samedi 2 octobre 2004 Statut Membre Dernière intervention 9 juillet 2013 7
24 févr. 2006 à 15:04
Salut
CMUgarphics est une lib qu'utilisait mon école. Mais tu peux la trouver sur internet (thanks google... lien http://cs.colgate.edu/APCS/C++/BorlandCMUInstall.html)

Pour le message d'erreur c'est normal, il essaie de raffraichir l'image alors que la fenetre graphique n'existe plus. J'ai pas encore trouver le moyen de supprimer le terminal en meme temps que la fenetre graphique.
mogwai93 Messages postés 362 Date d'inscription mardi 31 décembre 2002 Statut Membre Dernière intervention 4 novembre 2023
24 févr. 2006 à 13:41
t'as pas reconnu le taj mahal ? :-/
:-D
DeAtHCrAsH Messages postés 2670 Date d'inscription vendredi 25 janvier 2002 Statut Membre Dernière intervention 6 février 2013
24 févr. 2006 à 09:19
Elle est jolie la mosquée ^_^
mogwai93 Messages postés 362 Date d'inscription mardi 31 décembre 2002 Statut Membre Dernière intervention 4 novembre 2023
23 févr. 2006 à 20:19
il manque les fichiers cmugraphics.h et cmugraphics.cpp

et quand on veut quitter l'executable
la fenetre DOS affiche le message d'erreur :
Fatal Error : Failed to BilBlt in UpdateBuffer!
Rejoignez-nous