Instagram Style Photo Collage

How do I add the image in the centre and the borders?

I’ve made a collage of 4 images of (400, 400) dimensions.

firstly make border in the centre image, by the method cv2.copyMakeBorder(src, top, bottom, left, right, borderType, value), then int th image collage of 4 image just slice that part of matrix of image and replace it with this image .
like this, collage_image[100:300,100:300,:]=centre_image[:,:,:]
assumed centre image is of 200*200 px

Hey @developerkushal, i hope this doubt has already been resolved as on our whatsapp chat.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

How to put in csv please say?

convert your numpy array into (x,3) shape by np.reshape(image_name,(-1,3))
then convert array into the dataframe by using the pandas.dataframe() and then use pandas.to_csv to put ur dataframe into csv with the columns names as [‘r’,‘g’,‘b’].
like this:
pd.DataFrame(data=image_name).to_csv(“submission.csv”,header=[‘r’,‘g’,‘b’],index=False)
pd.DataFrame(data=image_name) this part will convert array into the data frame and the later part will save it into “submission.csv” file with the headers r,g,b

How could i make the borders (vertical border)?