Ask Your Question
0

Extracting only blue from given image

asked 2016-02-15 11:18:15 -0500

Dr Dre gravatar 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 )

cv2.waitKey(0)
cv2.destroyAllWindows()

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

edit retag flag offensive close merge delete

Comments

2

@sturkmen

In the code that u have provided

lower_blue = np.array([110,50,50])
upper_blue = np.array([130,255,255])

is this range bgr value of hsv image ??? or hsv value

Dr Dre gravatar imageDr Dre ( 2016-02-15 18:55:57 -0500 )edit
2

it is obvious

# define range of blue color in HSV
lower_blue = np.array([110,50,50])
upper_blue = np.array([130,255,255])
sturkmen gravatar imagesturkmen ( 2016-02-16 03:44:32 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-02-26 08:31:46 -0500

Dr Dre gravatar image

http://docs.opencv.org/3.1.0/df/d9d/t...

This link helped me to find the solution

edit flag offensive delete link more

Comments

Thank U @sturkmen

Dr Dre gravatar imageDr Dre ( 2016-02-26 08:34:33 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2016-02-15 11:18:15 -0500

Seen: 148 times

Last updated: Feb 26 '16