1

I want to identify the red value of an image. but i cannot identify the red dot.the program only shows the blue value ?

import cv2
import numpy as np
img=cv2.imread("C:\Users\My Kindom\Documents\Youcam\mihira.JPG")
hsv=cv2.cvtColor(img,cv2.COLOR_BGR2HSV)
lower_red=np.array([100,50,50])
upper_red=np.array([130,255,255])
mask=cv2.inRange(hsv,lower_red,upper_red)
cv2.imshow("image",mask)
cv2.waitKey(0)
Thamasha
  • 347
  • 2
  • 4
  • 9
  • also have a look at http://stackoverflow.com/a/32523532/5008845 – Miki Nov 17 '15 at 16:36
  • 1
    have a look at hue range of color red. It's around 0 and 360 so for OpenCV (not sure about python openCV) it is scaled to around 0 and 180. You are looking at values between 100 and 130 (=200-260 scaled) which is part of blue: https://de.wikipedia.org/wiki/HSV-Farbraum#/media/File:HueScale.svg – Micka Nov 17 '15 at 17:14
  • Thank you...you solved my problem – Thamasha Nov 17 '15 at 22:51

0 Answers0