ora1, ora2 progress

This commit is contained in:
2025-09-18 16:42:22 +02:00
commit 57380d3b55
16 changed files with 145 additions and 0 deletions

5
ora1/Makefile Normal file
View File

@@ -0,0 +1,5 @@
CFLAGS = `pkg-config --cflags opencv4`
LIBS = `pkg-config --libs opencv4`
% : %.cpp
g++ $(CFLAGS) $(LIBS) -o $@ $<

BIN
ora1/Tokyo_Pink.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1015 KiB

BIN
ora1/kep.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
ora1/main Executable file

Binary file not shown.

34
ora1/main.cpp Normal file
View File

@@ -0,0 +1,34 @@
#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;
}

BIN
ora1/main2 Executable file

Binary file not shown.

37
ora1/main2.cpp Normal file
View File

@@ -0,0 +1,37 @@
#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);
Mat img2(200, 50, CV_8UC1);
Mat img3(200, 50, CV_8UC3);
Mat img4(200, 50, CV_8UC3);
img4.setTo(Scalar(0,0, 255)); //szinezes
Mat img5(img.rows, img.cols, img.type());
Mat mask(img.rows, img.cols, CV_8UC1);
Mat mask2 = Mat::zeros(img.size(), CV_8UC1); //kinullazot (fekete) mask (vagy barmi mas kep)
//masolat
Mat copy = img.clone(); //deepcopy
//copy.setTo(Scalar(255,0,0)); //shallow copy -> changes original
imshow("img", img);
imshow("copy", copy);
//imshow("Ablak", img2);
//imshow("Ablak2", img3);
//imshow("Ablak3", img4);
//imshow("Ablak3", img5);
//imshow("Ablak4", mask);
//imshow("Ablak6", mask2);
waitKey();
return 0;
}