Thanks...
opencv and opencv2 are different right?
my opencv have many library ("highgui", "cv" and so on) but opencv2 only have one library call "opencv"...so ur opencv2 have many library is it?
-----------------------------------------------------------------------------------
If I use
using namespace cv;
so at the program, I only need to type
CvtColor
instead of
cvCvtColor
is it?
[Just wanted to know more as many online sources use this way, but I don't understand it, hope u can help]
-----------------------------------------------------------------------------------
actually for both of the link above, i got read it, but don't understand how to use them...
i solve my problem with the code below...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
#include <opencv/highgui.h>
#include <opencv/cv.h>
int main( int argc, char** argv ) {
IplImage* img = cvLoadImage("C:/Users/123/Desktop/PROJECT/1.jpg");
IplImage *destination = cvCreateImage(
cvSize( img->width, img->height ), IPL_DEPTH_8U, 1 );
cvCvtColor( img, destination, CV_RGB2GRAY );
cvNamedWindow( "Example1", CV_WINDOW_AUTOSIZE );
cvShowImage( "Example1", img );
cvNamedWindow( "Example2", CV_WINDOW_AUTOSIZE );
cvShowImage("Example2", destination);
cvWaitKey(0);
cvReleaseImage( &img );
cvDestroyWindow( "Example1" );
}
|
Now, I'm able to display both RGB and Gray image on the screen.
Just curious how to use
imshow()
inside my program above [just another knowledge if u willing to help me]
Hope to get answer from u for all my 3 questions above...
Thanks a lot...^^