imports "clustering" from "MLkit";
require(graphics2D);
multishapes = read.csv("./multishapes.csv");
[x, y] = list(multishapes[, "x"], multishapes[, "y"]);
print(multishapes, max.print = 13);
# detect object shapes
objects = graphics2D::pointVector(multishapes[, "x"], multishapes[, "y"]) |> dbscan_objects();
objects[objects == "-1"] = "noise";
objects = ifelse(objects == "noise", objects, `object_${objects}`);
# show object detection result
bitmap(file = "./object_detection.png") {
plot(multishapes[, "x"], multishapes[, "y"],
class = objects,
grid.fill = "white",
padding = "padding: 125px 300px 200px 200px;",
colorSet = "paper"
);
}
Latest posts by 谢桂纲 (see all)
- 【MZKit】简单自动化组织分区 - 2023年11月5日
- 【MZKit教程】质谱成像原始数据文件查看 - 2023年6月29日
- 生物序列图嵌入算法 - 2023年6月29日
No responses yet