Minimize usages of legacy C API inside the library
This commit is contained in:
@@ -10,7 +10,8 @@
|
||||
#include <iostream>
|
||||
#include <cstring>
|
||||
|
||||
#include "opencv2/opencv.hpp"
|
||||
#include "opencv2/contrib.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
static void help(std::string errorMessage)
|
||||
{
|
||||
@@ -28,7 +29,7 @@ static void drawPlot(const cv::Mat curve, const std::string figureTitle, const i
|
||||
cv::Mat displayedCurveImage = cv::Mat::ones(200, curve.size().height, CV_8U);
|
||||
|
||||
cv::Mat windowNormalizedCurve;
|
||||
normalize(curve, windowNormalizedCurve, 0, 200, CV_MINMAX, CV_32F);
|
||||
normalize(curve, windowNormalizedCurve, 0, 200, cv::NORM_MINMAX, CV_32F);
|
||||
|
||||
displayedCurveImage = cv::Scalar::all(255); // set a white background
|
||||
int binW = cvRound((double)displayedCurveImage.cols/curve.size().height);
|
||||
@@ -80,8 +81,7 @@ static void drawPlot(const cv::Mat curve, const std::string figureTitle, const i
|
||||
normalize(hist, normalizedHist, 1, 0, cv::NORM_L1, CV_32F); // normalize histogram so that its sum equals 1
|
||||
|
||||
double min_val, max_val;
|
||||
CvMat histArr(normalizedHist);
|
||||
cvMinMaxLoc(&histArr, &min_val, &max_val);
|
||||
minMaxLoc(normalizedHist, &min_val, &max_val);
|
||||
//std::cout<<"Hist max,min = "<<max_val<<", "<<min_val<<std::endl;
|
||||
|
||||
// compute density probability
|
||||
|
Reference in New Issue
Block a user