0

I have a list

list_1=[a[0],a[1],....,a[15]]

a[0],a[1],...,a[15] are pieces of an image

I want to concatenate from list_1[0] to list_2[15] as 4x4

But it will be parametrically. I mean, If there are 4 pieces of image (a[0] to a[3])

it will be 2x2 .

If there are 25 pieces, 5x5.

how can i use hconcat and vconcat functions.

I hope,I can tell

RandList is list_1

sayi=2 for 2x2

l = []
m=[]

for j in range(sayi*sayi):
    if j<sayi*sayi/2:
       l.append(RandListe[j])
    if j>=sayi*sayi/2:
       m.append(RandListe[j])



Horiz1 = cv2.hconcat(l)
Horiz2 = cv2.hconcat(m)
bothVert = cv2.vconcat((Horiz1, Horiz2))

I did like this. But it works just 2x2

  • Have you given it a try? If not please do. If so please show your code. – Julien Jul 26 '18 at 07:28
  • Possible duplicate of [Create a 2D list out of 1D list](https://stackoverflow.com/questions/14681609/create-a-2d-list-out-of-1d-list) – Sean Pianka Jul 26 '18 at 17:04

0 Answers0