Move legacy part of opencv_contrib to separate header
This commit is contained in:
@@ -39,7 +39,7 @@
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <ctime>
|
||||
#include "opencv2/contrib/contrib.hpp"
|
||||
#include "opencv2/contrib/compat.hpp"
|
||||
#include "opencv2/highgui/highgui_c.h"
|
||||
|
||||
static void help(char **argv)
|
||||
|
@@ -32,7 +32,7 @@ static Mat toGrayscale(InputArray _src) {
|
||||
Mat src = _src.getMat();
|
||||
// only allow one channel
|
||||
if(src.channels() != 1) {
|
||||
CV_Error(CV_StsBadArg, "Only Matrices with one channel are supported");
|
||||
CV_Error(Error::StsBadArg, "Only Matrices with one channel are supported");
|
||||
}
|
||||
// create and return normalized image
|
||||
Mat dst;
|
||||
@@ -44,7 +44,7 @@ static void read_csv(const string& filename, vector<Mat>& images, vector<int>& l
|
||||
std::ifstream file(filename.c_str(), ifstream::in);
|
||||
if (!file) {
|
||||
string error_message = "No valid input file was given, please check the given filename.";
|
||||
CV_Error(CV_StsBadArg, error_message);
|
||||
CV_Error(Error::StsBadArg, error_message);
|
||||
}
|
||||
string line, path, classlabel;
|
||||
while (getline(file, line)) {
|
||||
@@ -82,7 +82,7 @@ int main(int argc, const char *argv[]) {
|
||||
// Quit if there are not enough images for this demo.
|
||||
if(images.size() <= 1) {
|
||||
string error_message = "This demo needs at least 2 images to work. Please add more images to your data set!";
|
||||
CV_Error(CV_StsError, error_message);
|
||||
CV_Error(Error::StsError, error_message);
|
||||
}
|
||||
// Get the height from the first image. We'll need this
|
||||
// later in code to reshape the images to their original
|
||||
|
@@ -178,7 +178,7 @@ int main(int argc, char** argv)
|
||||
if( intrinsic_filename )
|
||||
{
|
||||
// reading intrinsic parameters
|
||||
FileStorage fs(intrinsic_filename, CV_STORAGE_READ);
|
||||
FileStorage fs(intrinsic_filename, FileStorage::READ);
|
||||
if(!fs.isOpened())
|
||||
{
|
||||
printf("Failed to open file %s\n", intrinsic_filename);
|
||||
@@ -194,7 +194,7 @@ int main(int argc, char** argv)
|
||||
M1 *= scale;
|
||||
M2 *= scale;
|
||||
|
||||
fs.open(extrinsic_filename, CV_STORAGE_READ);
|
||||
fs.open(extrinsic_filename, FileStorage::READ);
|
||||
if(!fs.isOpened())
|
||||
{
|
||||
printf("Failed to open file %s\n", extrinsic_filename);
|
||||
|
@@ -59,15 +59,15 @@ static void matPrint(Mat &img, int lineOffsY, Scalar fontColor, const string &ss
|
||||
Point org;
|
||||
org.x = 1;
|
||||
org.y = 3 * fontSize.height * (lineOffsY + 1) / 2;
|
||||
putText(img, ss, org, fontFace, fontScale, CV_RGB(0,0,0), 5*fontThickness/2, 16);
|
||||
putText(img, ss, org, fontFace, fontScale, Scalar(0,0,0), 5*fontThickness/2, 16);
|
||||
putText(img, ss, org, fontFace, fontScale, fontColor, fontThickness, 16);
|
||||
}
|
||||
|
||||
|
||||
static void displayState(Mat &canvas, bool bHelp, bool bGpu, bool bLargestFace, bool bFilter, double fps)
|
||||
{
|
||||
Scalar fontColorRed = CV_RGB(255,0,0);
|
||||
Scalar fontColorNV = CV_RGB(118,185,0);
|
||||
Scalar fontColorRed = Scalar(255,0,0);
|
||||
Scalar fontColorNV = Scalar(118,185,0);
|
||||
|
||||
ostringstream ss;
|
||||
ss << "FPS = " << setprecision(1) << fixed << fps;
|
||||
|
Reference in New Issue
Block a user