Hmm, ovaj matetmaticki problem je ustvari pitanje na konkursu za programere kod Amazon-a : )
Koliko razumem isti je problem samo je kod mene drugacija projekcija tacaka (koju sam odradio) i treba mi 1 x N matrica umesto M x N
Ovo nalazi najveci region i onda znam da mi je to objekat koji se prati, sve ostalo su smetnje.
Quote:Find length of the largest region in Boolean Matrix
Consider a matrix with rows and columns, where each cell contains either a ‘0’ or a ‘1’ and any cell containing a 1 is called a filled cell. Two cells are said to be connected if they are adjacent to each other horizontally, vertically, or diagonally. If one or more filled cells are also connected, they form a region. find the length of the largest region.
https://www.geeksforgeeks.org/find-lengt...an-matrix/
Examples:
Input : M[][5] = {
0 0 1 1 0
1 0 1 1 0
0 1 0 0 0
0 0 0 0 1 }
Output : 6
In the following example, there are
2 regions one with length 1 and the
other as 6. So largest region: 6
Input : M[][5] = {
0 0 1 1 0
0 0 1 1 0
0 0 0 0 0
0 0 0 0 1 }
Output: 6
In the following example, there are
2 regions one with length 1 and the
other as 4. So largest region: 4
Koliko razumem isti je problem samo je kod mene drugacija projekcija tacaka (koju sam odradio) i treba mi 1 x N matrica umesto M x N
Ovo nalazi najveci region i onda znam da mi je to objekat koji se prati, sve ostalo su smetnje.