Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

yes, opencv has javascript bindings !

I would like rgba(0, 0, 255, 255) in return

some quite unusual format, and not supported from opencv (if you meant that literally).

but you can use cvtColor():

  • to convert to to grayscale
  • or to convert it to either LAB,YUV or YCbCr, and split() off the luminance channel (L or Y)


both approaches will result in a single channel, uchar image.

(alpha, being irrelevant in comuter-vision, will just get discarded)

yes, opencv has javascript bindings !

I would like rgba(0, 0, 255, 255) in return

some quite unusual format, and not supported from opencv (if you meant that literally).

but you can use cvtColor():

  • to convert to to grayscale
  • or to convert it to either LAB,YUV or YCbCr, and split() off the luminance channel (L or Y)


both approaches will result in a single channel, uchar image.

(alpha, being irrelevant in comuter-vision, computer-vision, will just get discarded)