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日
4 Responses
有两只挨着的母鸡在二值化之后就分不开了
CCL算法没法处理这种连接的对象有这个缺点
This algorithm cannot help me count how many hens there are in the picture.
The algorithm failed to achieve the expected results, primarily because the color details of some hens were not preserved in the binarized image, lacking sufficient information to distinguish them.