I was referring the open-cv dense optical-flow code and and I found the following :
hsv[...,1] = 255
What is the meaning of this?
Code : https://docs.opencv.org/3.4/d4/dee/tutorial_optical_flow.html
I was referring the open-cv dense optical-flow code and and I found the following :
hsv[...,1] = 255
What is the meaning of this?
Code : https://docs.opencv.org/3.4/d4/dee/tutorial_optical_flow.html
For the array hsv
all values in the first column are set to 255. I believe open-cv took the syntax from numpy
hsv = np.random.randint(0, 10, (3,5))
>>> arr = np.random.randint(0, 10, (3,5, 4))
>>> arr
array([[[7, 7, 8, 3],
[2, 7, 6, 6],
[6, 8, 6, 6],
[7, 5, 7, 6],
[4, 1, 1, 7]],
[[5, 4, 1, 0],
[2, 2, 2, 0],
[4, 4, 7, 4],
[8, 5, 9, 3],
[5, 6, 4, 7]],
[[8, 6, 3, 3],
[5, 4, 6, 4],
[3, 4, 1, 9],
[8, 0, 5, 4],
[5, 0, 7, 6]]])
>>> arr[..., 1] = 255
>>> arr
array([[[ 7, 255, 8, 3],
[ 2, 255, 6, 6],
[ 6, 255, 6, 6],
[ 7, 255, 7, 6],
[ 4, 255, 1, 7]],
[[ 5, 255, 1, 0],
[ 2, 255, 2, 0],
[ 4, 255, 7, 4],
[ 8, 255, 9, 3],
[ 5, 255, 4, 7]],
[[ 8, 255, 3, 3],
[ 5, 255, 6, 4],
[ 3, 255, 1, 9],
[ 8, 255, 5, 4],
[ 5, 255, 7, 6]]])