Ask Your Question

vahni's profile - activity

2020-09-26 08:15:47 -0600 received badge  Student (source)
2018-06-27 05:13:14 -0600 commented question cvtColor TypeError:

Please look at the accepted answer here: http://answers.opencv.org/question/19... which deals with a similar problem.

2018-06-27 05:12:58 -0600 answered a question cvtColor TypeError:

Please look at the accepted answer here: http://answers.opencv.org/question/194586/cvtcolor-doesnt-take-3-channel-images

2018-06-27 05:06:22 -0600 received badge  Supporter (source)
2018-06-27 05:06:04 -0600 marked best answer cvtColor doesn't take 3-channel images

I have the following code:

img_plane_rgb = imread('baboon.jpg')
img_plane_rgb_sc = img_plane_rgb.astype(float)/255
cv2.cvtColor(img_plane_rgb, img_plane_hsi,cv2.COLOR_BGR2HSV)

The error that I get is

TypeError: only length-1 arrays can be converted to Python scalars

The documentation says that an image read using imread should be usable in cvtColor. Even if I pass img_plane_rgb[1,:,0] as an argument the error persists, even though it is now a 1D array.

What other modification needs to be done to use cvtColor?

2018-06-27 05:06:04 -0600 received badge  Scholar (source)
2018-06-27 04:57:41 -0600 commented question removing noise using connected components

Is it necessary to use connected components? Have you tried median filter? It is good for removing small splotches.

2018-06-27 04:57:41 -0600 asked a question cvtColor doesn't take 3-channel images

cvtColor doesn't take 3-channel images I have the following code: img_plane_rgb = imread('baboon.jpg') img_plane_rgb_sc