1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- #include <iostream>
- #include <core/image/ImageT.h>
- #include <core/image/FilterT.h>
- #ifdef NICE_USELIB_QT
- #include <core/imagedisplay/ImageDisplay.h>
- #endif
- using namespace NICE;
- using namespace std;
- int main ( int argc, char **argv )
- {
- if ( (argc != 2) ) {
- cerr << "usage: " << argv[0] << " <image>" << endl;
- exit(-1);
- }
-
- ColorImage srcColor ( argv[1] );
-
- #ifdef NICE_USELIB_GLUT
- #ifdef NICE_USELIB_QT
- showImage ( srcColor );
- #else
- cerr << "Visualization disabled: no QT library available" << endl;
- #endif
- #else
- cerr << "Visualization disabled: no GLUT library available" << endl;
- #endif
-
- Image src;
- rgbToGray ( srcColor, &src );
-
-
-
-
-
- FloatImage gradient;
- FilterT<unsigned char, float, float>::gradientStrength( src, gradient );
- ColorImage gradientColor;
- imageToPseudoColor ( gradient, gradientColor );
- #ifdef NICE_USELIB_GLUT
- #ifdef NICE_USELIB_QT
- showImage ( gradientColor );
- #endif
- #endif
- }
|