The question has been previously asked before https://answers.opencv.org/question/181963/decreasing-size-of-opencvjs/.
Basically, I only want to use a bilateral filter for my web application. The current OpenCV.js file is around 11MB which is overkill. How can I only copy and build the relevant functions from OpenCV to my project?
I am using the following code only:
let src = cv.imread(imgElement);
let dst = new cv.Mat();
cv.cvtColor(src, src, cv.COLOR_RGBA2RGB, 0);
cv.bilateralFilter(src, dst, 9, 75, 75, cv.BORDER_DEFAULT);
cv.imshow('canvasOutput', dst);
src.delete(); dst.delete();