123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- /*
- * @Description:
- * @Version: 1.0
- * @Autor: lishengyin
- * @Date: 2022-03-22 14:00:35
- * @LastEditors: lishengyin
- * @LastEditTime: 2022-03-25 09:58:35
- */
- #ifndef __INFINEFILTER_H_
- #define __INFINEFILTER_H_
- #include <memory>
- #include <string>
- #include <vector>
- #include <map>
- #include <list>
- #include <queue>
- #include "cnstream_frame.hpp"
- #include "cnstream_module.hpp"
- #include "easyinfer/model_loader.h"
- #include "easytrack/easy_track.h"
- #include "cnstream_frame_va.hpp"
- #include "opencv2/highgui/highgui.hpp"
- #include "opencv2/imgproc/imgproc.hpp"
- #include "opencv2/dnn.hpp"
- #include "opencv2/opencv.hpp"
- #include "opencv2/highgui.hpp"
- #include "opencv2/imgcodecs/imgcodecs.hpp"
- #include <rapidjson/document.h>
- #include <rapidjson/rapidjson.h>
- #include <rapidjson/stringbuffer.h>
- #include <rapidjson/writer.h>
- #include <ctime>
- #include <iostream>
- #include <time.h>
- #include <cstdlib>
- #include <dirent.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- using namespace std;
- namespace cnstream{
- // Pointer for frame info
- using CNFrameInfoPtr = std::shared_ptr<CNFrameInfo>;
- /// Pointer for infer object
- using CNInferObjectPtr = std::shared_ptr<CNInferObject>;
- class InfineFilter : public cnstream::Module, public cnstream::ModuleCreator<InfineFilter> {
- using super = cnstream::Module;
-
- public:
- explicit InfineFilter(const std::string &name) : super(name) {}
- bool Open(cnstream::ModuleParamSet paramSet) override;
- void Close() override { std::cout << this->GetName() << " Close called" << std::endl; }
- int Process(std::shared_ptr<cnstream::CNFrameInfo> data) override;
- bool filter(cv::Mat image, std::shared_ptr<cnstream::CNInferObject>& object);
-
- bool getNight(cv::Mat image);
- std::string getTime();
- private:
- InfineFilter(const InfineFilter &) = delete;
- InfineFilter &operator=(InfineFilter const &) = delete;
-
- vector<std::string> labels;
- bool saveFilterResult = true;
- std::string files = "./output/";
- int start = 21;
- int end = 6;
- };
- };
- #endif
|