i am using open CV and i am facing this error

Anirudh Kumar Aheer
import cv2
import numpy as np
frameWidth = 640
frameHeight = 480

cap = cv2.VideoCapture(0)
cap.set(3,frameWidth)
cap.set(4,frameHeight)
cap.set(10,150)

myColors=[[5,107,0,19,255,255],
         [133,56,0,159,156.255],
         [57,76,0,100,255,255]]

def findColors(img,myColors):
    imgHSV = cv2.cvtColor(img,cv2.COLOR_BGR2HSV)
    for color in myColors:
        lower =  np.array(color[0:3])
        upper =  np.array(color[3:6])
        mask  = cv2.inRange(imgHSV, lower, upper)
        cv2.imshow(str(color[0]),mask)

while True:
    success, img = cap.read()
    findColors(img,myColors)
    cv2.imshow("result", img)
    if cv2.waitKey(1) & 0xFF == ord ('q'):
        break

I have been trying to create a colour tracker which would go about tracing the colour from the camera and i have been stuck here awhile any help would be appreciated

error: (-209:Sizes of input arguments do not match) The upper boundary is neither an array of the same size and same type as src, nor a scalar in function 'cv::inRange'

Can someone help me here

Christoph Rackwitz

there is a typo in your code.

[133,56,0,159,156.255],

use a , there, not a .

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

When I am closing Codeblocks I am facing this error

Am I facing overflow?

I am getting a Open cv error when working with object detection

I am facing error while scraping the data

I am facing End of file reached error

Why am I facing with unsupported Svg error

I am facing a error ReferenceError: Paginator is not defined

After reloading the page, I am facing this error

I am am facing issue in left join

i am facing LNK2019 error uresolved external error

I am trying to accessing the object through React facing error

I am facing "No adapter attached; skipping layout" error

I am facing an error "No adapter attached; skipping layout"

Why am I facing with empty graph without any error?

I am facing an Undefined Variable:Notice Error in PHP

I am facing an error in removing image button background

In android studio 3.0, I am facing compile time error

want to show portfolio images but i am facing some error

but i am facing an error on travis for singed apk generation

I am facing runtime error while building an android application

What is the logical error I am facing in Pascal's Triangle code?

Why I am facing an error in moving object detection using opencv python?

I am facing a problem in Pagination using states in React JS

I am facing problems displaying audio file using python

I am facing problem using Simple React Lightbox Next js?

I am working on window based report application. I am facing #Error at run time when value will "*"

I am facing this kind of error when I am going to create flutter app in vs code, How I fix this error?

I am facing Dagger implementation issue

I am facing problem in linked list in python