I need to get an image and extract the color channels(RGB) and then merge Green and Blue ones, what am I doing wrong(Using OpenCV.js)
<button type="button" onclick="filter('Aneritra')">Aneritra</button>
<script> function filter(filter_name){ if(filter_name == 'Aneritra'){ let src = cv.imread('Selected_Image'); let dst = new cv.Mat(); let rgbaPlanes = new cv.MatVector(); // Split the src cv.split(src, rgbaPlanes); // Get G channel let G = rgbaPlanes.get(1); // Get B channel let B = rgbaPlanes.get(2); // Merge G & B channels cv.merge((G,B), dst); cv.imshow('canvasOutput', dst); src.delete(); dst.delete(); rgbaPlanes.delete(); } } </script>