123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- #pragma once
- #define _CRT_SECURE_NO_WARNINGS
- #include <iostream>
- #include <fstream>
- #include <string>
- #include <math.h>
- #include <opencv2/imgproc.hpp>
- #include <opencv2/highgui.hpp>
- #include <onnxruntime_cxx_api.h>
- using namespace cv;
- using namespace std;
- using namespace Ort;
- class AtmosphericPressureALGO
- {
- public:
- void Init();
- bool detect(Mat cv_image);
- float resultValue;
- private:
- void creat_line_image(int Radius, int RingStride);
- void get_meter_reader();
- private:
- int inpWidth;
- int inpHeight;
- int outWidth;
- int outHeight;
- //vector<float> input_image_ = { 1, 3, 512, 512 };
- const float mean[3] = { 0, 0, 0 };
- const float stds[3] = { 0.6f, 0.6f, 0.6f };
- Env env = Env(ORT_LOGGING_LEVEL_ERROR, "u2net");
- Ort::Session* ort_session = nullptr;
- SessionOptions sessionOptions = SessionOptions();
- vector<char*> input_names;
- vector<char*> output_names;
- vector<vector<int64_t>> input_node_dims; // >=1 outputs
- vector<vector<int64_t>> output_node_dims; // >=1 outputs
- Mat dstimg;
- };
|