Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Why not showing the image as it is

I am uploading the image , here is my code

Mat mSrc = imread("E:\\my.jpg");
imshow("orignal" , mSrc);
waitKey();

my image is of 7 mb and its not uploading here

Why not showing the image as it isHow to make color balance of photoshop using opencv

I want to make the same thing programmatically like Color balance in Photoshop , like in below image

image description

if we have same bar positions in Photoshop then how we can make them in OpenCV , because the problem which I am uploading not understanding is that we have the image , here with RGB format yes we can convert in other color format but how I can understand these values (do we need to subtract the Cyan values in OpenCV if Cyan Level is my code-20 in PS ? Or we need to Add ?) and did the same operation in OpenCV , For example if I need to change values in Cyan , Magenta and Blue Do I need to convert image first to add values in Cyan and magenta and then convert it back to BGR and then increase blue ? And is there any built in function in OpenCv for Shadows , MidTones and Highlight

Mat mSrc = imread("E:\\my.jpg");
imshow("orignal" , mSrc);
waitKey();

my image is of 7 mb and its not uploading here

How to make color balance of photoshop using opencv

I want to make the same thing programmatically like Color balance in Photoshop , like in below image

image description

if we have same bar positions in Photoshop then how we can make them in OpenCV , because the problem which I am not understanding is that we have the image with RGB format yes we can convert in other color format but how I can understand these values (do we need to subtract the Cyan values in OpenCV if Cyan Level is -20 in PS ? Or we need to Add ?) and did the same operation in OpenCV , For example if I need to change values in Cyan , Magenta and Blue Do I need to convert image first to add values in Cyan and magenta and then convert it back to BGR and then increase blue ? And is there any built in function in OpenCv for Shadows , MidTones and Highlight

I am trying something like this

    Mat img = imread("E:\\raw_3.jpg");
    vector<Mat> colors;
    split(img,colors);
    colors[0] += 69;
    colors[1] += 40 ;
    colors[2] -= 23 ;
    merge(colors,img);
    imshow("image" , img);
    imwrite("E:\\color_balance.jpg",img);
    waitKey();

for Cyan - red = -23 Magenta - Green = 40 Yellow - Blue = 69 But i am not getting the accurate result as it should be

How Trying to make color balance of photoshop using opencv

I want to make the same thing programmatically like Color balance in Photoshop , like in below image

image description

if we have same bar positions in Photoshop then how we can make them in OpenCV , because the problem which I am not understanding is that we have the image with RGB format yes we can convert in other color format but how I can understand these values (do we need to subtract the Cyan values in OpenCV if Cyan Level is -20 in PS ? Or we need to Add ?) and did the same operation in OpenCV , For example if I need to change values in Cyan , Magenta and Blue Do I need to convert image first to add values in Cyan and magenta and then convert it back to BGR and then increase blue ? And is there any built in function in OpenCv for Shadows , MidTones and Highlight

I am trying something like this

    Mat img = imread("E:\\raw_3.jpg");
    vector<Mat> colors;
    split(img,colors);
    colors[0] += 69;
    colors[1] += 40 ;
    colors[2] -= 23 ;
    merge(colors,img);
    imshow("image" , img);
    imwrite("E:\\color_balance.jpg",img);
    waitKey();

for Cyan - red = -23 Magenta - Green = 40 Yellow - Blue = 69 But i am not getting the accurate result as it should be

Trying to make color balance of photoshop using opencv

I want to make the same thing programmatically like Color balance in Photoshop , like in below image

image description

if we have same bar positions in Photoshop then how we can make them in OpenCV , because the problem which I am not understanding is that we have the image with RGB format yes we can convert in other color format but how I can understand these values (do we need to subtract the Cyan values in OpenCV if Cyan Level is -20 in PS ? Or we need to Add ?) and did the same operation in OpenCV , For example if I need to change values in Cyan , Magenta and Blue Do I need to convert image first to add values in Cyan and magenta and then convert it back to BGR and then increase blue ? And is there any built in function in OpenCv for Shadows , MidTones and Highlight

I am trying something like this

    Mat img = imread("E:\\raw_3.jpg");
    vector<Mat> colors;
    split(img,colors);
    colors[0] += 69;
    colors[1] += 40 ;
    colors[2] -= 23 ;
    merge(colors,img);
    imshow("image" , img);
    imwrite("E:\\color_balance.jpg",img);
    waitKey();

for Cyan - --- red = -23 Magenta - --- Green = 40 Yellow - --- Blue = 69 But i am not getting the accurate result as it should be

Trying to make color balance Adjusting pixel values of photoshop using opencvDark and White

I want to make Here is the same thing programmatically like Color balance in Photoshop , like in below imagedefinition which i read from the net source

image description

if we have same bar positions in Photoshop then how we can make them in OpenCV , because the problem which I am not understanding is that we have the image with RGB format yes we can convert in other color format but how I can understand these values (do we need to subtract the Cyan values in OpenCV if Cyan Level is -20 in PS ? Or we need to Add ?) and did the same operation in OpenCV , For example if I need to change values in Cyan , Magenta and Blue Do I need to convert image first to add values in Cyan and magenta and then convert it back to BGR and then increase blue ? And is there any built in function in OpenCv for Shadows , MidTones and Highlight

I am trying something like this1st is

    Mat img Midtone: Situated between the darkest tone (Black), and the brightest tone (White). For a 24 bit colour image, this occurs when Red = imread("E:\\raw_3.jpg");
    vector<Mat> colors;
    split(img,colors);
    colors[0] += 69;
    colors[1] += 40 ;
    colors[2] -= 23 ;
    merge(colors,img);
    imshow("image" , img);
    imwrite("E:\\color_balance.jpg",img);
    waitKey();
Green = Blue = 128.

and the other is

Tones created by dots between 30% and 70% of coverage

What i got from these definition is that the pixels whose values are 0 or 255 we should adjust them to 128 . Am i taking the definition right ? I don't want to use the way of Histogram Equalization as according to my knowledge its also use for Cyan --- red = -23 Magenta --- Green = 40 Yellow --- Blue = 69 But i am not getting the accurate result as it should bebrightness of image

Adjusting pixel values of Dark and White

Here is the definition which i read from the net source

1st is

Midtone: Situated between the darkest tone (Black), and the brightest tone (White). For a 24 bit colour image, this occurs when Red = Green = Blue = 128.

and the other is

Tones created by dots between 30% and 70% of coverage

and

Midtone also refers to the range of colors that aren't mixed with black (the shadows) or white (the highlights).

What i got from these definition is that the pixels whose values are 0 or 255 we should adjust them to 128 . Am i taking the definition right ? I don't want to use the way of Histogram Equalization as according to my knowledge its also use for brightness of image

Adjusting pixel values of Dark and WhiteWhite pixels values

Here is the definition which i read from the net source

1st is

Midtone: Situated between the darkest tone (Black), and the brightest tone (White). For a 24 bit colour image, this occurs when Red = Green = Blue = 128.

and the other is

Tones created by dots between 30% and 70% of coverage

and

Midtone also refers to the range of colors that aren't mixed with black (the shadows) or white (the highlights).

What i got from these definition is that the pixels whose values are 0 or 255 we should adjust them to 128 . Am i taking the definition right ? I don't want to use the way of Histogram Equalization as according to my knowledge its also use for brightness of image

Adjusting Dark and White pixels values

Here is the definition which i read from the net source

1st is

Midtone: Situated between the darkest tone (Black), and the brightest tone (White). For a 24 bit colour image, this occurs when Red = Green = Blue = 128. 128.

and the other is

Tones created by dots between 30% and 70% of coverage

and

Midtone also refers to the range of colors that aren't mixed with black (the shadows) or white (the highlights). highlights).

What i got from these definition is that the pixels whose values are 0 or 255 255 we should adjust them to 128 128 . Am i taking the definition right ? I don't want to use the way of Histogram Equalization as according to my knowledge its also use for brightness of image

I want to perform the function like below , like i want to perform this function in OpenCV C++ but i don't know the idea of how to deal with Midtones and CYMK values as it has both RGB and CMYK at the same time

image description

For example Sample image

enter image description here

After applying the above values

enter image description here

I want to do the same in OpenCV

My concern is only with the result if we can perform this with only RGB