Cricketer
Cricketer

Reputation: 2431

Can I smooth just 1 channel in a 3 channel image?

Is there a OpenCV way to (gaussian) smooth just 1 channel in a 3 channel (RGB) image?

Any of Python or C or C++ OpenCV is fine.

Upvotes: 1

Views: 171

Answers (1)

Subhasis Das
Subhasis Das

Reputation: 1677

You can use Split to split the image into its channels and then use Filter2D on one of the components.

Split(src, src_r, src_g, src_b)
Smooth(src_r, dst_r)
Merge(dst_r, src_g, src_b, dst)

Upvotes: 2

Related Questions