Files
kepfeldolgozas/ora4/main.cpp

27 lines
502 B
C++
Raw Normal View History

2025-10-02 16:00:02 +02:00
#include "histo.h"
#include <opencv2/core.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include <iostream>
using namespace cv;
int main(){
2025-10-09 17:30:43 +02:00
Mat img = imread("dark_img.jpg", IMREAD_GRAYSCALE);
2025-10-02 16:00:02 +02:00
imshow("img", img);
Histo::showHisto(img);
double ah, fh;
minMaxLoc(img, &ah, &fh);
2025-10-09 17:30:43 +02:00
fh = 30;
2025-10-02 16:00:02 +02:00
Mat dest = (ah == fh) ? img.clone() : (img-ah) * 255 / (fh-ah);
imshow("dest", dest);
2025-10-09 17:30:43 +02:00
Histo::showHisto(dest, "eredmeny");
waitKey();
2025-10-02 16:00:02 +02:00
return 0;
}