English 中文(简体)
如何算出双面图像中的形体数?
原标题:What is an efficient algorithm for finding the number of shapes in a binary image?

关于宾图,我有兴趣有效地计算图像中的个人形体。 同样,作为邻里的问题,人们如何适应在广场形象中体现的各种形态?

Pseudocode是最受欢迎的。

最佳回答

我可以回答后半部分,但如果上半部分将“沙皮”定义为某种颜色的毗连性皮,我就这样做了。 保持整个图像的阵列,显示哪些雕像是“黄的”。 (A bool[,] do the trick, in C#-speak.)

然后开始对每张钢材进行循环处理。 如果已经看到,它就会ski。

否则,如果看不到它,它就带有“非沙皮”的颜色,就将其看到并移走。

否则,它就没有见到,而且是一种形式。 从这里看,四条绕行路线中的每一条都有间谍。 如果你看上见,就会停下来,回头(这防止了一场无限的循环发生)。 如果六氯苯是非蓝色,就立即标出并停止。 否则,六氯苯是一种形状色。 在你正在积累的“血清定义”数据上加起来。

一旦这一进程完成,你就发现了一种形态。 将其存放在其他地方,并继续搜寻。 现在应该看到这种形形形形色色的螺纹,不再由算法来考虑。

一旦形成状物色素堆积了,这种形状分解法必然会发生逆转,大形可能过度流入。 或许应当利用一种以蒸.为基础的阻塞办法来进行整个形状的搜索。

(如果你认为直径相邻的餐具足以将两种形状连接成一种,只是搜查所有8个相邻的餐厅,而不只是4个横向和纵向相邻的餐厅)。)

问题回答

“沙皮”的可能概念是相关组成部分。 在该案中,一项经限定的算法将给予你希望:。 如果你也想到X和Y级,可以扩大工会定义,以追踪这些地方。

改变图像数据时,你将采用所有图象和尺寸(形状的中继器)进行每一形状。

如果你的形象在体内形成,那么博览会将既作为个体体处理。

如果需要密码寄送我邮件,将乐于分享。





相关问题
How to add/merge several Big O s into one

If I have an algorithm which is comprised of (let s say) three sub-algorithms, all with different O() characteristics, e.g.: algorithm A: O(n) algorithm B: O(log(n)) algorithm C: O(n log(n)) How do ...

Grokking Timsort

There s a (relatively) new sort on the block called Timsort. It s been used as Python s list.sort, and is now going to be the new Array.sort in Java 7. There s some documentation and a tiny Wikipedia ...

Manually implementing high performance algorithms in .NET

As a learning experience I recently tried implementing Quicksort with 3 way partitioning in C#. Apart from needing to add an extra range check on the left/right variables before the recursive call, ...

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

Enumerating All Minimal Directed Cycles Of A Directed Graph

I have a directed graph and my problem is to enumerate all the minimal (cycles that cannot be constructed as the union of other cycles) directed cycles of this graph. This is different from what the ...

Quick padding of a string in Delphi

I was trying to speed up a certain routine in an application, and my profiler, AQTime, identified one method in particular as a bottleneck. The method has been with us for years, and is part of a "...

热门标签