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)
- 【GCModeller】Docker镜像开发记录 - 2023年5月24日
- 【转录组学】短测序Reads组装算法的简单实现 - 2023年5月7日
- 【Linux】工作中常用到的Linux运维笔记 - 2023年4月12日
No responses yet