티스토리 뷰

robot

[map merging] 파노라마 stitiching

별의 별 2021. 7. 19. 20:07

[map merging] 파노라마 stitiching

 


원래 난  opencv 3.xx 몇이였는지 기억이 안나는데 아무튼 3이었다.

그래서 stitchig 함수가 제대로 먹히지 않아

새롭게 opencv 4.2.0으로 깔았ㄷㅏ.

하루종일 opencv만 깔았다.

안깔려서

이게 컴퓨터가 안좋으니까

인터넷 창을 켜두니까 계속 오류가 났던건지

아님 몇번의 시도 끝에 된거지 아직 모르겠다

아무튼 화가난다.

 


 

import numpy as np
import cv2
import os
import sys


img_names = ['lab.pgm', 'lab2.pgm']


imgs = []
for name in img_names:
    img = cv2.imread(name)

    if img is None:
        print('Image load failed!')
        sys.exit()

    imgs.append(img)


stitcher = cv2.Stitcher_create()

status, dst = stitcher.stitch(imgs)

if status != cv2.Stitcher_OK:
    print('Stitch failed!')
    sys.exit()


cv2.imwrite('output.jpg', dst)


cv2.namedWindow('dst', cv2.WINDOW_NORMAL)
cv2.imshow('dst', dst)
cv2.waitKey()
cv2.destroyAllWindows()

기본적인 파노라마 하는 법

https://deep-learning-study.tistory.com/266

 

[파이썬 OpenCV] 파노라마 영상 만들기 - 이미지 스티칭 - cv2.Stitcher_create, cv2.Stitcher.stitch

이미지 스티칭 - Image Stitching  이미지 스티칭은 동일 장면의 사진을 자연스럽게(seamless) 붙여서 한 장의 사진으로 만드는 기술입니다.  사진 이어 붙이기, 파노라마 영상(Panorama image)  기본적인

deep-learning-study.tistory.com

 

참고해서 진행

 

 

'robot' 카테고리의 다른 글

[map merging] 맵 합치기  (0) 2021.07.21
[map merging] OpenCv - feature matching  (0) 2021.07.14
[gmapping map size] 맵 사이즈 변경  (0) 2021.07.12
[kobuki] 내비게이션 파라미터 조정  (0) 2021.07.05
[꼬부기/kobuki] navigation  (0) 2021.06.25
댓글