Ce code permet d'appliquer différents filtres sur une image JPG: filtres Passe Bas, Passe Haut, detection des bords, lissage gaussien...
La plus part de ses filtres sont une convolution des matrices RVB par une matrice 3x3. (ex pour un passe bas on convolue l'image par {[1 1 1][1 1 1][1 1 1]} , pour un passe haut{[0,1,0][1,-4,1][0,1,0]...}
Toutes les convolutions sont expliquées dans le code.
Pour éxécuter le prog, il faut absolument que l'image que vous voulez chargé se trouve dans le MEME REPERTOIRE que l'éxécutable AVEC LE NOM : test.JPG sinon il y aura une erreur à l'ouverture.
Mon site internet :
http://pistol.petesampras.free.fr/
Conclusion :
Conseil: ne charger pas d'image trop grosse car cela peut prendre du temps...
16 févr. 2012 à 17:55
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+
16 févr. 2012 à 17:46
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
29 nov. 2007 à 22:19
En fait, j'avais oublié d'ajouter le CMUgraphic...lib au projet. 9a marche maintenant.
Merci.
29 nov. 2007 à 12:30
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 ?
27 nov. 2007 à 23:28
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)
Vous n'êtes pas encore membre ?
inscrivez-vous, c'est gratuit et ça prend moins d'une minute !
Les membres obtiennent plus de réponses que les utilisateurs anonymes.
Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.
Le fait d'être membre vous permet d'avoir des options supplémentaires.