Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Extracting only blue from given image

Hi Guys

I Have an input image as

image description

I Have used the following code to brighten blue

import cv2
import numpy as np

Image = cv2.imread('blue.jpg')

Threshold = np.zeros(Image.shape, np.uint8)
cv2.threshold(Image, 121, 255, cv2.THRESH_BINARY, Threshold)
cv2.imshow("WindowName", Threshold )


The output of this code is

image description

I want to extract only the blue portion of this image and eliminate the remaining ..

The output should be anything like these images

image description

image description

image description

I am using python2.7 with cv2