bool Gray2RGB::process() { assert(m_inputPin != 0); assert(m_outputPin != 0); CvMatData src = m_inputPin->get(); // allocate a target buffer CvMatData target; target.create( src.width(), src.height(), src.type() ); // do a flip of the image const cv::Mat in = src; cv::Mat out = target; cv::flip( in, out, 1); // publish the new image m_outputPin->put( out ); // CvMatData in = m_inputPin->get(); //const cv::Mat& inputImage = in; //m_outputPin->put( inputImage ); return true; }
bool ImageThreshold::process() { CvMatData in = m_inputPin->get(); CvMatData out = CvMatData::create( in.width(), in.height(), in.type() ); const cv::Mat& src = in; cv::Mat& dst = out; // perform threshold operation on the image cv::threshold( src, dst, m_threshold, m_maxValue, m_method.getSelectedValue() ); // publish the new image m_outputPin->put( out ); return true; }