1 // 2 // Copyright © 2020 Arm Ltd and Contributors. All rights reserved. 3 // SPDX-License-Identifier: MIT 4 // 5 6 #include "CvWindowOutput.hpp" 7 8 namespace common 9 { 10 Init(const std::string & windowName)11void CvWindowOutput::Init(const std::string& windowName) 12 { 13 m_windowName = windowName; 14 cv::namedWindow(m_windowName, cv::WINDOW_AUTOSIZE); 15 } 16 WriteFrame(std::shared_ptr<cv::Mat> & frame)17void CvWindowOutput::WriteFrame(std::shared_ptr<cv::Mat>& frame) 18 { 19 cv::cvtColor(*frame, *frame, cv::COLOR_RGB2BGR); 20 cv::imshow( m_windowName, *frame); 21 cv::waitKey(30); 22 } 23 Close()24void CvWindowOutput::Close() 25 { 26 cv::destroyWindow(m_windowName); 27 } 28 IsReady() const29bool CvWindowOutput::IsReady() const 30 { 31 return true; 32 } 33 }// namespace common