我有一个黄色背景的图像,其中包含一个随机图形,如图所示:
随机图形被黑线分割成图像 block 。现在,每个部分都可以单独表示为包含具有透明背景的该部分图像的正方形。
我的问题是否可以通过算法在原始图像中找到每个部分的坐标?
我正在用 Java 编写这个应用程序。
我对图形不太了解。如果可能的话请详细说明一下。
最佳答案
假设图像看起来与您这里的大部分相似
Loop
Find a Red pixel
If found
flood fill red to non-red at this point, remembering region
create output image from this region
else
You are done
关于java - 分割图像并获取坐标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4086722/