Skip to content
Advertisement

Displaying Opencv.js Matrix without cv.imshow()

Hello Stack Overflow community.

I am attempting to extract the pixel values from a cropped section of an opencv matrix to a javascript array in order to feed that data into a tensor for OCR. I cannot use cv.imshow() because it interacts with the DOM and my process is on a web worker.

This is what I have so far to convert from Opencv to js array:

JavaScript

If you paste this code into Opencv IDE and click try it the output seems to be offsetting weirdly. What am I doing wrong here?

Thanks in advance for the help!!

Advertisement

Answer

I believe this should help you:

JavaScript

Refer the opencv.js documentation link for more details.

Advertisement