MCPcopy Create free account
hub / github.com/Smorodov/Multitarget-tracker / Frame

Class Frame

example/VideoExample.h:25–152  ·  view source on GitHub ↗

\brief The Frame struct

Source from the content-addressed store, hash-verified

23/// \brief The Frame struct
24///
25class Frame
26{
27public:
28 Frame() = default;
29 Frame(cv::Mat imgBGR, bool useCLAHE)
30 {
31 m_mBGR = imgBGR;
32 if (useCLAHE)
33 {
34 m_clahe = cv::createCLAHE(1.2, cv::Size(4, 4));
35 AdjustMatBGR();
36 }
37 }
38
39 ///
40 void SetUseAdjust(bool useCLAHE)
41 {
42 if (useCLAHE)
43 {
44 m_clahe = cv::createCLAHE(1.2, cv::Size(4, 4));
45 AdjustMatBGR();
46 }
47 else
48 {
49 m_clahe.reset();
50 }
51 }
52
53 ///
54 bool empty() const noexcept
55 {
56 return m_mBGR.empty();
57 }
58
59 ///
60 const cv::Mat& GetMatBGR() const noexcept
61 {
62 return m_mBGR;
63 }
64 ///
65 cv::Mat& GetMatBGRWrite()
66 {
67 m_umBGRGenerated = false;
68 m_mGrayGenerated = false;
69 m_umGrayGenerated = false;
70 return m_mBGR;
71 }
72 ///
73 bool AdjustMatBGR()
74 {
75 if (m_mBGR.empty() || m_clahe.empty())
76 return false;
77
78 cv::cvtColor(m_mBGR, m_mHSV, cv::COLOR_BGR2HSV);
79 cv::split(m_mHSV, m_chansHSV);
80 m_clahe->apply(m_chansHSV[2], m_chansHSV[2]);
81 cv::merge(m_chansHSV, m_mHSV);
82 cv::cvtColor(m_mHSV, m_mBGR, cv::COLOR_HSV2BGR);

Callers

nothing calls this directly

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected