123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- #ifndef MODULES_OSD_HPP_
- #define MODULES_OSD_HPP_
- #include <memory>
- #include <string>
- #include <unordered_map>
- #include <vector>
- #include "opencv2/highgui/highgui.hpp"
- #include "opencv2/imgproc/imgproc.hpp"
- #include "cnstream_module.hpp"
- namespace cnstream {
- class CnOsd;
- class Osd : public Module, public ModuleCreator<Osd> {
- public:
-
- explicit Osd(const std::string& name);
-
- ~Osd();
-
- bool Open(cnstream::ModuleParamSet paramSet) override;
-
- void Close() override;
-
- int Process(std::shared_ptr<CNFrameInfo> data) override;
-
- bool CheckParamSet(const ModuleParamSet& paramSet) const override;
- private:
- std::shared_ptr<CnOsd> GetOsdContext();
- std::unordered_map<std::thread::id, std::shared_ptr<CnOsd>> osd_ctxs_;
- RwLock ctx_lock_;
- std::vector<std::string> labels_;
- std::vector<std::string> secondary_labels_;
- std::vector<std::string> attr_keys_;
- std::string font_path_ = "";
- std::string logo_ = "";
- float text_scale_ = 1;
- float text_thickness_ = 1;
- float box_thickness_ = 1;
- float label_size_ = 1;
- };
- }
- #endif
|