估计阅读时长: 2 分钟

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)

Attachments

No responses yet

Leave a Reply

Your email address will not be published. Required fields are marked *

博客文章
August 2025
S M T W T F S
 12
3456789
10111213141516
17181920212223
24252627282930
31  
  1. […] 在完成了仿真计算后,针对得到的计算结果文件,接下来我们就可以通过dump_stream函数将计算得到的每一帧的数据以热图的形式导出来,在指定的文件夹中生成每一帧的数据热图结果。在进行热图渲染的时候,可以参考之前写的讲解颜色调色板的文章中列举出来的颜色版进行热图的颜色设置。 […]