Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

imshow equivalence in Java

How do you do imshow (as in C++) in the Java binding of OpenCv ? I cannot find any reference of it in Highgui.

#include <cv.h>
#include <highgui.h>

using namespace cv;

int main( int argc, char** argv){
 char* imageName = argv[1];
 Mat image;
 image = imread( imageName, 1 );

 if( argc != 2 || !image.data ) {
   printf( " No image data \n " );
   return -1;
 }
 namedWindow( imageName, CV_WINDOW_AUTOSIZE );
 imshow( imageName, image );
 waitKey(0);
 return 0;
}

imshow equivalence in Java

How do you do imshow (as in C++) in the Java binding of OpenCv ? I cannot find any reference of it in Highgui.Highgui. The example below shows the use of imshow as in C++. I would like to ask for the equivalence in Java.

#include <cv.h>
#include <highgui.h>

using namespace cv;

int main( int argc, char** argv){
 char* imageName = argv[1];
 Mat image;
 image = imread( imageName, 1 );

 if( argc != 2 || !image.data ) {
   printf( " No image data \n " );
   return -1;
 }
 namedWindow( imageName, CV_WINDOW_AUTOSIZE );
 imshow( imageName, image );
 waitKey(0);
 return 0;
}