Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Multiple Videocapture object for a new written single video

Hi,

How can I write a multiple VideoCapture object as an separating variable like VideoCapture() named cap1 for Video A, cap2 for VideoB and so on.

def make4side(image, scale=0.5):    
    # image = cv2.imread(image)
    h = int((image.shape[0])) #height
    w = int((image.shape[1])) #width
    image = cv2.resize(image, (w,h ), interpolation = cv2.INTER_CUBIC) #shrink image to half

    output = np.zeros((w+h+h , w + h + h, 3), dtype="uint8")

# top 
    output[0:h, h:h+w] = image 
# left >> rotate 90
    output[h:h+w, 0:h] = np.rot90(image,1) 
# right >> rotate 270
    output[h:h+w, h+w:h+w+h] = np.rot90(image,3)  
# bottom >> rotate 180
    output[h+w:h+w+h, h:h+w] = np.rot90(image,2) 

    return output

The code above is the function which I am going to apply during the time I read the VideoCapture. For this, its only read just one single file which is image. My question is how can I write a Videocapture object to read multiple videos and named it separately like cap1, cap2 so that I can placed for example cap1 for a top side, cap2 for left side, cap3 for right side and cap4 for bottom side (by changing the image in each of the side to be exact video that I want to place)

Thank you