估计阅读时长: 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

4 Responses

    • 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.

      来自广西

Leave a Reply

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

博客文章
September 2025
S M T W T F S
 123456
78910111213
14151617181920
21222324252627
282930  
  1. うわー、すごいですね。Warcraftのサーバープログラムのインストール方法を教えてくれませんか?