Berikut codingan nya:
//BISMILLAH - Dzikri Purnama - Free to Copy&Paste
//Displaying Image
#include <opencv2/core/core.hpp>Kalo udah langsung di compile and execute aja. Khusus untuk baris:
#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;
}
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.
1 Response to "OpenCV Ubuntu C++ - Menampilkan gambar"
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 익산 출장마사지
Post a Comment