增加Mat数据获取

This commit is contained in:
2025-03-17 11:51:48 +08:00
parent 84f388f294
commit 27a24d0073
6 changed files with 36 additions and 5 deletions

View File

@ -8,6 +8,7 @@ async function test() {
const res = await cv.imread("test_data/im1.jpeg");
// const res = await cv.imdecode(buffer);
const cropIm = cv.crop(res, { x: 10, y: 10, width: 300, height: 200 });
console.log(cropIm.data)
console.log(cv.imwrite("test_data/cropIm.jpg", cropIm));
fs.writeFileSync("test_data/base.jpg", cv.imencode(".jpg", res)!);