OpenCV와 OpenCV.js는 동일한 라이브러리 기반이지만, 기능과 사용 방식에서 몇 가지 차이가 있습니다
import cv2
img = cv2.imread('image.jpg')
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
cv2.imshow('Gray Image', gray)
cv2.waitKey(0)
cv2.destroyAllWindows()
let imgElement = document.getElementById('imageSrc');
let inputImage = cv.imread(imgElement);
let grayScale = new cv.Mat();
cv.cvtColor(inputImage, grayScale, cv.COLOR_RGBA2GRAY);
cv.imshow('canvasOutput', grayScale);
grayScale.delete(); // 메모리 해제
inputImage.delete(); // 메모리 해제
canvas.toDataURL() (3) | 2024.09.16 |
---|---|
property accessors, dot notation, bracket notation, 점 표기법, 대괄호 표기법, 속성접근자 (0) | 2024.09.16 |
HSL 색상 - Three.js, canvas, css (1) | 2024.09.13 |
구면좌표계, spherical coordinate system (1) | 2024.09.12 |
NDC - Normalized Device Coordinates - three.js (1) | 2024.09.10 |