Centerline returns a centerline.geometry.Centerline which is a multilinestring. You have to iterate through the multilinestring and get the coordinates of the first and last point from the line parts.
Here is a simple code:
from shapely.geometry import Polygon
from centerline.geometry import Centerline
import numpy as np
polygon = Polygon([[0, 0], [0, 4], [4, 4], [4, 0]])
centerline = Centerline(polygon)
c_array = np.zeros((len(centerline),4), dtype=float)
for i, l in enumerate(centerline):
ll = list(l.coords)
c_array[i] = [ll[0][0], ll[0][1], ll[-1][0], ll[-1][1]]
c_array will be:
[[0.25 3.75 0.75 3.25]
[3.75 3.75 3.25 3.25]
[1.25 2.75 1.75 2.25]
[0.75 3.25 1.25 2.75]
[2.75 2.75 2.25 2.25]
[3.25 3.25 2.75 2.75]
[2. 2. 2.25 2.25]
[2. 2. 1.75 2.25]
[1.25 1.25 1.75 1.75]
[2. 2. 1.75 1.75]
[0.75 0.75 1.25 1.25]
[0.25 0.25 0.75 0.75]
[2. 2. 2.25 1.75]
[2.75 1.25 3.25 0.75]
[3.75 0.25 3.25 0.75]
[2.25 1.75 2.75 1.25]]
p.s. it is funny to see some Hungarian words in your code :)