#include "ImageMultiOutputRed.h" #include using namespace std; ImageMultiOutputRed::ImageMultiOutputRed(short channelIndex) { m_channelIndex = channelIndex; } ImageMultiOutputRed::~ImageMultiOutputRed(void) { } std::vector ImageMultiOutputRed::apply(cv::Mat& pDib) { std::vector retMats; if (pDib.empty()) return retMats; retMats.push_back(pDib); filterColor(pDib, m_channelIndex); retMats.push_back(pDib); return retMats; } void ImageMultiOutputRed::filterColor(cv::Mat& image, short channel) { if (image.channels() == 1) return; cv::extractChannel(image, image, channel); }