Ask Your Question

MingCheng's profile - activity

2020-03-26 04:42:02 -0500 commented question opencv kalman filter(python) problem when no detection

Basically is just the problem of when there is no measurement input, the result of the kalman filter prediction will not

2020-03-25 23:20:30 -0500 edited question opencv kalman filter(python) problem when no detection

opencv kalman filter(python) problem when no detection Hi, when I am trying to use the opencv Kalman Filter to track a

2020-03-25 22:43:23 -0500 edited question opencv kalman filter(python) problem when no detection

opencv kalman filter(python) problem when no detection Hi, when I am trying to use the opencv Kalman Filter to track a

2020-03-25 22:19:36 -0500 asked a question opencv kalman filter(python) problem when no detection

opencv kalman filter(python) problem when no detection Hi, when I am trying to use the opencv Kalman Filter to track a

2019-12-18 04:17:14 -0500 asked a question Kalman filter predict both velocity and position

Kalman filter predict both velocity and position Hi, I trying to follow the example, in this site, https://blog.csdn.n

2019-12-12 02:26:40 -0500 commented question Basic openCV contour questions

Thank you very much for the advice.

2019-12-12 02:25:39 -0500 commented answer drawing a rectangle around a color as shown?

Hi may I know that what is the meaning of the line "key=cv2.contourArea" in the max() function. Thank you for reading th

2019-12-04 03:59:03 -0500 commented answer syntax error for cv2.inRange[Solved]

Thank you, I was too careless.

2019-12-04 03:55:51 -0500 marked best answer syntax error for cv2.inRange[Solved]

Hi, May I ask that why I get a syntax error for the line output = cv.inRange(hsv, lower_blue, upper_blue). The code is shown below:

import numpy as np
import cv2  as cv   
con=[]
image = cv.imread('2.jpg')
hsv = cv.cvtColor(image, cv.COLOR_RGB2HSV)

lower_blue = np.array([1,80,53])
upper_blue = np.array([53,205,255]
output = cv.inRange(hsv, lower_blue, upper_blue)
con = cv.findContours(output.copy(),cv.RETR_LIST,cv.CHAIN_APPROX_NONE)
print(con)
#print(hier)
cv.imshow('img', image)
cv.waitKey(0)

Thank you for the help

2019-12-04 03:54:59 -0500 commented question Basic openCV contour questions

My apologies, here is the relevant portion. bluecnts = cv2.findContours(mask.copy(),cv2.RETR_EXTERNAL,cv2.CHAIN_APPROX_S

2019-12-04 02:59:35 -0500 asked a question syntax error for cv2.inRange[Solved]

syntax error for cv2.inRange Hi, May I ask that why I get a syntax error for the line output = cv.inRange(hsv, lower_b

2019-12-04 01:44:14 -0500 marked best answer slide bar not working and unable to draw contours

Hi, I am a beginner to openCV, and wanted trying to implement a slide bar and draw a contours around the masked image. My code is shown as below:

May I also ask that: 1. Sometimes, there is a square bracket with values e.g. [-1], [0] behind the function cv.findContours(mask,cv.RETR_TREE,cv.CHAIN_APPROX_NONE), what are they these square brackets with values is used for? 2. I found contours, hierarchy = cv.findContours(image, mode, method[, contours[, hierarchy[, offset]]]) in the openCV official website. I understand that we can pass in image,mode,and method to the function, but what is the meanning of [, contours[, hierarchy[, offset]]]

Thank you for reading.

import numpy as np
import cv2 as cv
def empty(x):
    pass

#lower_blue = np.array([1,80,53])
#upper_blue = np.array([200,205,255])

img = np.zeros((512,512,3),np.uint8)
cv.rectangle(img,(100,100),(277,307),(155,0,0),-1,)
#cv.circle(img,(450,450),50,(155,0,0),-1)
#img = cv.imread("orange.jpg")
hsv = cv.cvtColor(img, cv.COLOR_BGR2HSV)
cv.namedWindow("my_mask")
cv.createTrackbar("LH","my_mask",0,255,empty)
cv.createTrackbar("LS","my_mask",0,255,empty)
cv.createTrackbar("LV","my_mask",0,255,empty)
cv.createTrackbar("UH","my_mask",255,255,empty)
cv.createTrackbar("US","my_mask",255,255,empty)
cv.createTrackbar("UV","my_mask",255,255,empty)
LH = cv.getTrackbarPos("LH", "my_mask")
LS = cv.getTrackbarPos("LS", "my_mask")
LV = cv.getTrackbarPos("LV", "my_mask")
UH = cv.getTrackbarPos("UH", "my_mask")
US = cv.getTrackbarPos("US", "my_mask")
UV = cv.getTrackbarPos("UV", "my_mask")
#lower = np.array([LH,LS,LV])
#upper = np.array([UH,US,UV])
lower = np.array([0,100,100])
upper = np.array([255,255,255])
mask = cv.inRange (hsv, lower, upper)
countours = cv.findContours(mask,cv.RETR_TREE,cv.CHAIN_APPROX_NONE) #it returns a turples, every element of turples starts with "array", it is verified by using len()
#Barea = cv.contourArea
#print(len(countours))
#print(countours[2])
#cv.drawContours(img,[countours],-1,(0,255,255),5)
cv.imshow("original",img)
cv.imshow("my_mask",mask)

cv.waitKey(0)

cv.destroyAllWindows()
2019-12-04 01:44:14 -0500 received badge  Scholar (source)
2019-12-04 01:41:05 -0500 edited question Basic openCV contour questions

Basic openCV contour questions Hi, May I ask that what is the meaning of this line of code: "key=cv2.contour

2019-12-04 01:41:05 -0500 received badge  Editor (source)
2019-12-04 01:39:03 -0500 asked a question Basic openCV contour questions

Basic openCV contour questions Hi, 1. May I ask that what is the meaning of this line of code: "key=cv2.cont

2019-10-16 04:44:21 -0500 received badge  Enthusiast
2019-10-15 08:53:14 -0500 asked a question slide bar not working and unable to draw contours

slide bar not working and unable to draw contours Hi, I am a beginner to openCV, and wanted trying to implement a slid

2019-09-16 01:55:16 -0500 asked a question Installed Opencv 4.1.2 pre on Ubuntu 16.04 but version shown is 2.4.9

Installed Opencv 4.1.2 pre on Ubuntu 16.04 but version shown is 2.4.9 Hi, Recently I installed opencv 4.1.2 pre on Ub

2019-09-16 01:55:15 -0500 asked a question Installed Opencv 4.1.2 pre on Ubuntu 16.04 but version shown is 2.4.9

Installed Opencv 4.1.2 pre on Ubuntu 16.04 but version shown is 2.4.9 Hi, Recently I installed opencv 4.1.2 pre on Ub