Is there a way to convert opencv object (mat object) to blob in javascript?

Currently I am figuring out how can we convert directly opencv object to blob without using canvas? Any help here

which kind of blob are you talking about ? please explain !

Image blob. Currently I am writing opencv object into canvas usingimshow and then converting blob using toBlob(). If there is a way in opencv which would directly convert images without using canvas.

what do you want to do with it ?
would ImageData do the trick ?

you could look at the imshow() code:

I used cv.blobFromImage to convert opencv Mat object directly to blob, no canvas needed.

const blob = cv.blobFromImage(
    image,  // cv.Mat
    1 / 128,  // scalefactor
    new cv.Size(inputWeight, inputHeight),  // size
    new cv.Scalar(inputMean, inputMean, inputMean),  // mean
    true  // swapRB
);

See OpenCV: Deep Neural Network module for API docs.

nice, but imo you misread it.
question seems not about opencv’s dnn blobs, but about html5 image