OpenCV Ubuntu C++ - Menampilkan gambar

Astagaaa, yang dasar-dasar malah belum di post -____- Sori ya kalo ada yang masih bingung cara nampilin gambar di opencv. Soalnya dari kemarin-kemarin kan kita belajar olah video hehehe Langsung aja saya kasih hasilnya:





Berikut codingan nya:


//BISMILLAH - Dzikri Purnama - Free to Copy&Paste

//Displaying Image
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <iostream>

using namespace cv;
using namespace std;

int main()
{
  Mat img = imread("/home/alfarobi/OpenCv/play/exe/tennis.jpg", CV_LOAD_IMAGE_UNCHANGED);

if (img.empty()){
cout << "Error : Image cannot be loaded..!!" << endl;
        return -1;
}

namedWindow("MyWindow", CV_WINDOW_AUTOSIZE);"
imshow("MyWindow", img);

waitKey(0);

     destroyWindow("MyWindow");

return 0;
}
Kalo udah langsung di compile and execute aja. Khusus untuk baris:
  Mat img = imread("/home/alfarobi/OpenCv/play/exe/tennis.jpg", CV_LOAD_IMAGE_UNCHANGED);
 Bagian yang saya bold merupakan letak direktori file gambar berada. Sudah dulu, saya harap mungkin agan-agan sekalian sudah mengerti :D kalo belum ngeh, tanya lewat comment saja.

Related Posts:

1 Response to "OpenCV Ubuntu C++ - Menampilkan gambar"

pandorawaclawski said...

Casinos Near Harrah's Atlantic City - MapYRO
Harrah's Atlantic City is a hotel and casino located 충주 출장안마 in Atlantic City, New Jersey. The casino, 경상북도 출장마사지 located on a 창원 출장샵 5-acre site adjacent to the 사천 출장마사지 marina, is 익산 출장마사지