如何在2d数组中找到最大的数字

时间:2021-03-31 21:30:13

I have image with example of matrix with marked cells in it which makes a figures.

我有图像与矩阵的例子,其中有标记的单元格,这是一个数字。

如何在2d数组中找到最大的数字

The thing is, that I have to count and find the largest figure in the matrix.

问题是,我必须计算并找到矩阵中最大的数字。

As we can see there is 3 figures each with 3, 19 and 2 black fields.

我们可以看到有3个数字,每个数字有3个,19个和2个黑色字段。

Ok I understund how could I get if the cell is black or white, but how can I tell that figure is fully counted and which one is the biggest.

好吧,如果细胞是黑色或白色,我怎么能得到,但我怎么能知道这个数字是完全计算的,哪一个是最大的。

1 个解决方案

#1


3  

This is a task for connected component labeling algorithm

这是连接组件标记算法的任务

#1


3  

This is a task for connected component labeling algorithm

这是连接组件标记算法的任务