Connected Component Labeling(连通组件标记算法)主要用于识别并标记二值图像中相互连接的像素区域(即连通区域)。
imports "geometry2D" from "graphics";
imports "machineVision" from "signalKit";
let raw = readImage("—Pngtree—five chickens in different colors_3632916.jpg");
let bin = machineVision::ostu(raw, factor = 0.8);
let shapes = machineVision::ccl(bin);
print(`find ${length(shapes)} shapes.`);
bitmap(bin, file = "ostu_bin.bmp");
bitmap(file = "shapes.png", size = [3600, 2700]) {
plot(shapes, scatter = TRUE, padding = "padding: 5% 5% 10% 10%;");
}
Latest posts by 谢桂纲 (see all)
- CCL对象检测算法 - 2025年8月11日
- Boids鸟群模拟算法讲解 - 2025年8月10日
- 流体模拟计算 - 2025年8月9日
No responses yet