vendredi 10 juin 2016

OpenCV: 4 camera Bird's Eye view?


I am having quite a lot of trouble thinking of how to make a four camera bird's eye view like that seen in luxury cars. Here is the original that I will be using as an example for this question...enter image description here

Right now, I have made it so the image is skewed using .getPerspectiveTransform but that is just for one image.

enter image description here

I obviously need four and am clueless on how to stitch those images together. I am also clueless if this is how the images are supposed to look like. Here is the code I currently have:

import cv2 as cv
import numpy as np

img1 = cv.imread("testBird.jpg", cv.IMREAD_COLOR)
image = np.zeros((700, 700, 3), np.uint8)
src = np.array([[0,200],[480,200],[480,360],[0,360]],np.float32)
dst = np.array([[0,0],[480,0],[300,360],[180,360]],np.float32)

M = cv.getPerspectiveTransform(src, dst)
warp = cv.warpPerspective(img1.copy(), M, (480, 360))
cv.imshow('transform', warp)
cv.waitKey(0)
cv.destroyAllWindows()

and here is the end image that I would roughly like to have (A friend put together using Photoshop)...

enter image description here


Aucun commentaire:

Enregistrer un commentaire