The algorithm assumes that the color of the source image is close to that of the destination. This assumption means that when the colors don't match, the source image color gets tinted toward the color of the destination image.
.. [PM03] Patrick Perez, Michel Gangnet, Andrew Blake, "Poisson image editing", ACM Transactions on Graphics (SIGGRAPH), 2003.
-
.. ocv:function:: void decolor( InputArray src, OutputArray grayscale, OutputArray color_boost )
- :param src: Input 8-bit 3-channel image.
+ :param src: Input 8-bit 3-channel image.
:param grayscale: Output 8-bit 1-channel image.
{
for(int c = 0; c<channel; c++)
{
- temp.at<float>(i,j*channel+c) = temp.at<float>(i,j*channel+c) +
+ temp.at<float>(i,j*channel+c) = temp.at<float>(i,j*channel+c) +
(temp.at<float>(i,(j-1)*channel+c) - temp.at<float>(i,j*channel+c)) * V.at<float>(i,j);
}
}
*
* This tutorial demonstrates how to use OpenCV Decolorization Module.
*
+* Input:
+* Color Image
+*
* Output:
* 1) Grayscale image
* 2) Color boost image
int main(int argc, char *argv[])
{
+ CV_Assert(argc == 2);
Mat I;
I = imread(argv[1]);