Blue tint in image, how to adjust blue in OpenCV

Can you post an example?
You might have one of two problems:

  • either you chose an incorrect demosaic algorithm, which can switch red and blue channels, resulting in strange colors. Try to photograph a page with basic colors and see if the colors are correct. Otherwise try other demosaicing algorithms (BayerRG2RGB, BayerBG2RGB…)

  • or, as you said, the white balance is bad.
    This might already be corrected in the camera (refer to the camera API or use CAP_PROP_WB_TEMPERATURE or CAP_PROP_AUTO_WB if using the cv2.VideoCapture class).
    Otherwise multiply each channel with a constant. e.g. take a photo of a white paper sheet and measure the RGB values of the neutral color. Let’s say it’s R=150 G=180 B=200. To correct the white balance (python):

    im[:,:,0] = im[:,:,0]/200*150 #blue channel
    im[:,:,1] = im[:,:,1]/180*150 #green channel
    

    Now the white level should be correct.

Note: The HSV is a different color space, it’s only for image processing, not for diplay!