I don't understand some aspect in optical flow

Hi, everyone!
I’ve been coding an optical flow algorithm and have mentioned some interesting issue. The number of vectors returned by this part of code is equal to the y-size of an image:

import cv2 as cv
cap = cv.VideoCapture(0)
ret, frame1 = cap.read()
print(frame1.shape)
prvs = cv.cvtColor(frame1, cv.COLOR_BGR2GRAY)
while True:
    _, frame2 = cap.read()
    next = cv.cvtColor(frame2, cv.COLOR_BGR2GRAY)
    flow = cv.calcOpticalFlowFarneback(prvs, next, None, 0.5, 3, 15, 3, 5, 1.2, 0)
    mag = cv.cartToPolar(flow[..., 0], flow[..., 1], angleInDegrees=True)[0]
    ang = cv.cartToPolar(flow[..., 0], flow[..., 1], angleInDegrees=True)[1]
    print(len(mag))
    prvs = next

the result of the print is always 480 and I don’t understand why. Could anyone please explain me, why is it so?