inspirit / jsfeat

JavaScript Computer Vision library.
MIT License
2.74k stars 374 forks source link

How to transform canvas getImageData() to single channel matrix? #88

Open nwheatle opened 4 years ago

nwheatle commented 4 years ago

Hi I'm looking to use the image processing features of your library. The sobel_derivatives documentation says it uses "single channel only". jsfeat.imgproc.sobel_derivatives(source:matrix_t, dest:matrix_t); I don't know what is meant by single channel image.

How can I convert grayscaled getImageData() output ( [r0, g0, b0, a0, r1, g1, b0...] ) to a single channel matrix_t input for jsfeat.imgproc.sobel_derivatives?

Thank you for your help, Nicole