
            // 读取图像，构造mat数据
            let src = fcv.imread("sunrise_img");
            let meanVal = fcv.mean(src);

            let rect = new fcv.Rect(0, 0, 100, 100);
            let meanVal2 = fcv.mean(src, rect);

            // 可视化
            resultHtml.append("mean: " + meanVal.toString() + "\nrect mean: " + meanVal2.toString());

            // 内存回收
            src.delete();
            rect.delete();
        });
    </script>
</body>
</html>