How many combinations of k neighboring pixels are there in the image?

I suck in math, so I can’t figure it out: how many combinations of k neighboring pixels are in the image? Combinations of k pixels from n * n common pixels in the image, but with the restriction that they must be neighbors, for each k from 2 to n * n. I need a sum for all k values ​​for the program, which should take into account that many of the elements in the set that he discusses.

The neighbors are 4-connected and do not get along.

+3
source share
3 answers

k ( ), :

  • blob?
  • , (- )?

- ( 10 ^ 30 k = 56 - , k = 10 000), , 50 k.

(: wikipedia A_k.)

+2

, , .

, k :

Start          (end)-> any pixel after visiting k neighbours
*     - - - - -*
|     |
|     |
- - - -

, , .

, , , , ( ). , SAW (Self Avoiding Walks).

, : ! .

, 54 ( 16, , ). . , .

, ... .

+2

polyominos, , . O (4.0626 ^ n) , , O (8 ^ n). n = 14 5 , int. n = 30 17 , . 32 x 32 , , .

Now this does not mean what you want to do, it is difficult. Probably almost all the work that you do on one polyominal was partially done on others. It can be a fun task to speed up acceleration with dynamic programming. What are you trying to accomplish?

+1
source

Source: https://habr.com/ru/post/1753768/


All Articles