Translating code from C++

asked 2016-11-23 18:47:32 -0500

Hello,

I'm trying to learn OpenCV in JAVA, but I have really bad time searching for any source of information. I want to load and display an image using OpenCV exacly like in this tutorial below, but using JAVA: http://docs.opencv.org/trunk/db/deb/t...

int main( int argc, char** argv ) {
String imageName( "../data/HappyFish.jpg" ); // by default
if( argc > 1)
{
    imageName = argv[1];
}
Mat image;
image = imread( imageName, IMREAD_COLOR ); // Read the file
if( image.empty() )                      // Check for invalid input
{
    cout <<  "Could not open or find the image" << std::endl ;
    return -1;
}
namedWindow( "Display window", WINDOW_AUTOSIZE ); // Create a window for display.
imshow( "Display window", image );                // Show our image inside it.
waitKey(0); // Wait for a keystroke in the window
return 0; }

If you know any tutorials for OpenCV using JAVA I would be grateful if you could link them.

edit retag flag offensive close merge delete

Comments

may be here and all samples are here

LBerger gravatar imageLBerger ( 2016-11-24 08:28:26 -0500 )edit