// Includes, project. #include "CameraViewerComponent.hpp" // Includes, pacpus. #include #include #include #include // Includes, standard. #include #include #include using namespace pacpus; // Declare the logger and register the new component. //DECLARE_STATIC_LOGGER("pacpus.component.vislabCamera") //REGISTER_COMPONENT(CameraViewerComponent, "Camera"); ComponentFactory sFactory("CameraViewerComponent"); CameraViewerComponent::CameraViewerComponent(QString const& name) :ComponentBase(name) { } CameraViewerComponent::~CameraViewerComponent() { } void CameraViewerComponent::stopActivity() { } void CameraViewerComponent::startActivity() { qRegisterMetaType("cv::Mat"); connect(this, SIGNAL(doDisplay(cv::Mat)), SLOT(DisplayFrame(cv::Mat))); } ComponentBase::COMPONENT_CONFIGURATION CameraViewerComponent::configureComponent(XmlComponentConfig config) { return ComponentBase::CONFIGURED_OK; } void CameraViewerComponent::addInputs() { addInput("image", &CameraViewerComponent::process); } void CameraViewerComponent::DisplayFrame(cv::Mat const& frame) { //getchar(); //std::cout << getName().toStdString() << std::endl; cv::imshow(getName().toStdString(), frame); //cv::imshow("Image", frame); } /*! process function from the Display class with a cv:Mat parameter Emit the signal to diplay the frame */ void CameraViewerComponent::process(cv::Mat const& frame) { emit doDisplay(frame); }