25 lines
467 B
C++
25 lines
467 B
C++
#include "histo.h"
|
|
|
|
|
|
#include <opencv2/core.hpp>
|
|
#include <opencv2/highgui.hpp>
|
|
#include <opencv2/imgproc.hpp>
|
|
#include <iostream>
|
|
|
|
using namespace cv;
|
|
|
|
int main(){
|
|
Mat img = imread("debrecen_deep.png", IMREAD_GRAYSCALE);
|
|
imshow("img", img);
|
|
Histo::showHisto(img);
|
|
|
|
double ah, fh;
|
|
minMaxLoc(img, &ah, &fh);
|
|
|
|
Mat dest = (ah == fh) ? img.clone() : (img-ah) * 255 / (fh-ah);
|
|
|
|
imshow("dest", dest);
|
|
Histo::showHisto(dest);
|
|
return 0;
|
|
}
|