OpenCV / C++: Adding feather to the content of a shape in cv::Mat
Hi there
I have an image (irregular shaped) in some part of a cv::Mat object (cv::Mat(750, 750, CV_8UC4))
I would like to add 15px wide feather to around the shape in the cv::Mat object with some blur effect. Please note that I don't want to add blur to the shape itself. I need it added to the outside of the shape.
If you could please help me to achieve that, that would be much appreciated.
Hope the question makes sense.
Cheers
anyone using CV_8UC4 is not doing computer-vision, but plain image-processing (abuse of library ?).
What have you tried? Show us your code!
I have tried this but no luck!
int FEATHER_AMOUNT = 60; cv::Size blurSize = cv::Size(FEATHER_AMOUNT, FEATHER_AMOUNT); cv::resize(outputImage, outputImage, cv::Size(outputImage.rows + FEATHER_AMOUNT * 2, outputImage.cols + FEATHER_AMOUNT * 2)); outputImage = outputImage(cv::Rect(FEATHER_AMOUNT, FEATHER_AMOUNT, outputImage.rows - FEATHER_AMOUNT * 2, outputImage.cols - FEATHER_AMOUNT * 2)); cv::GaussianBlur(outputImage, outputImage, blurSize, 0);