Open akshayacharya97 opened 3 years ago
This project strongly depends on being able to geotag images or video frames before processing them. This way items found in the final stitch can be geolocated accurately. If you capture camera location and orientation along with the video, it's possible to add geotag info to the video frames as you extract them from the video. (Then stitch those frames together.) One trick to doing this with dji videos is to enable captions when recording and the location of the drone is recorded in the caption files and can be used later when extracting video frames. I do this when flying very low altitude survey missions by hand (sometimes flying under tree branches and following tricky terrain contours.)
This project strongly depends on being able to geotag images or video frames before processing them. This way items found in the final stitch can be geolocated accurately. If you capture camera location and orientation along with the video, it's possible to add geotag info to the video frames as you extract them from the video. (Then stitch those frames together.) One trick to doing this with dji videos is to enable captions when recording and the location of the drone is recorded in the caption files and can be used later when extracting video frames. I do this when flying very low altitude survey missions by hand (sometimes flying under tree branches and following tricky terrain contours.)
Hi, I am doing a ground mission. Its just a regular horizontal video. I want to break the adjacent frames such that there is an overlap. And then i want to stitch these to get one long image. I will show you the kind of output I am getting right now. Also, I will attach the source code for reference.
I want something like this
` import imutils import cv2 import glob
input_path = "/Users/akshayacharya/Desktop/Panorama/Raw Data/riverside/*.jpg"
list_images = glob.glob(input_path) list_sorted = sorted(list_images) print(list_sorted)
output_path = "/Users/akshayacharya/Desktop/Panorama/Final Panorama/finalpanoex1.jpg"
images = [] for image in list_sorted: image1 = cv2.imread(image) image1 = cv2.resize(image1, (720, 480)) images.append(image1)
print("Read the images")
final = [images[0]]
flag = True
print(len(images))
temp = [images[0]]
print(type(temp))
stitcher = cv2.createStitcher() if imutils.is_cv3() else cv2.Stitcher_create()
i = 0
while(i < len(images)-1):
(status, stitched) = stitcher.stitch([temp[0], images[i+1]])
if status == 0:
final.append(images[i+1])
print(f"Succesfully stitch {i} to {i+1}")
i = i+1
temp[0] = stitched
continue
if status != 0:
print(f"Succesfully could not stitch {i} to {i + 1}")
for j in range(i+2, len(images)):
print(f"now trying {i} to {j}")
(status, stitchedd) = stitcher.stitch([temp[0], images[j]])
if status == 0:
print(f"Succesfully managed to stitch {i} to {j}")
final.append(images[j])
i=j
temp[0] = stitchedd
break
if status != 0:
print(f"Oops could not stitch {i} to {j}")
print(f"Will now see compatibility between {i} and {j+1}")
continue
i += 1
continue
print("Now stitching the final") (status, stitches) = stitcher.stitch(final) print(status)
if status == 0:
cv2.imwrite(output_path, temp[0])`
Hi, I see that your project has similarity with what i want to achieve. I have a video obtained by placing a camera on a robot and recoding a particlar row of plants. I want to break this video into frames and then stitch this to create a long panorama of the row. How do I go about it using your code? Do you ave any other method you would suggest?