35 lines
813 B
C++
35 lines
813 B
C++
|
|
#include <opencv2/core.hpp>
|
||
|
|
#include <opencv2/highgui.hpp>
|
||
|
|
#include <opencv2/imgproc.hpp>
|
||
|
|
#include <iostream>
|
||
|
|
|
||
|
|
using namespace cv;
|
||
|
|
|
||
|
|
int main(){
|
||
|
|
Mat img = imread("kep.jpg", IMREAD_UNCHANGED);
|
||
|
|
|
||
|
|
if(img.empty()){
|
||
|
|
std::cout << "Missing picture" << std::endl;
|
||
|
|
exit(-1);
|
||
|
|
}
|
||
|
|
|
||
|
|
std::cout << "sor: " << img.rows << std::endl;
|
||
|
|
std::cout << "oszlop: " << img.cols << std::endl;
|
||
|
|
std::cout << "csatornak: " << img.channels() << std::endl;
|
||
|
|
|
||
|
|
int t = img.type();
|
||
|
|
if(t == CV_8UC1){ //8bit u->unsigned c1 -> 1 channel
|
||
|
|
std::cout << "szurkeskala (8 bit)" << std::endl;
|
||
|
|
}else if (t == CV_8UC3){
|
||
|
|
std::cout << "szineskep (24 bit)" << std::endl;
|
||
|
|
}else{
|
||
|
|
std::cout << "egyik sem" << std::endl;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
imshow("Ablak", img);
|
||
|
|
waitKey();
|
||
|
|
|
||
|
|
return 0;
|
||
|
|
}
|