Ask Your Question
0

Why doesn't splitting by HSV and then merging into BGR produce the same result?

asked 2018-09-24 11:59:21 -0600

Ecoste gravatar image

Just the frame looks like: image description

 h, s, v = cv2.split(frame)
 frame = cv2.merge([h, s, v])
 frame = cv2.cvtColor(frame, cv2.COLOR_HSV2BGR)

However when you split by hsv and then merge it back it looks like:

image description

Why? Shouldn't they be the same?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2018-09-24 12:12:21 -0600

berak gravatar image

updated 2018-09-24 12:13:35 -0600

i might be missing something, but it looks like your 1st line of code:

h, s, v = cv2.split(frame)

is just "whishful thinking"

it only would be HSV IF you had a corresponding:

 hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
 h, s, v = cv2.split(hsv) # NOT frame, here, which is still BGR, not HSV
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2018-09-24 11:59:21 -0600

Seen: 1,236 times

Last updated: Sep 24 '18