본문 바로가기

Linux Ubuntu Grub 복구 방법 윈도우 설치나 리눅스가 설치 되어있는 상태에서 다른 하드에 설치하다가 Grub이 날라가는 경우가 있다. 그래서 본인은 리눅스를 다시 깐 적도 많았는데 그럴 필요 없이 Grub 복구만 해주면 된다. 일단 LinuxLive 부팅 USB로 부팅한다. (or 리눅스 설치 CD) Ctrl + Alt + T 를 눌러 터미널을 연다. $ sudo add-apt-repository ppa:yannubuntu/boot-repair $ sudo apt-get update $ sudo apt-get install -y boot-repair $ sudo boot-repair 이 때 인터넷이 연결되어있어야 진행되므로 주의한다. boot-repair 프로그램이 아래 그림과 같이 실행될 것이다. Recommended repair ..
직선 차선 검출 하기 import cv2 import numpy as np import matplotlib.pyplot as plt def canny(image): gray = cv2.cvtColor(image, cv2.COLOR_RGB2GRAY) blur = cv2.GaussianBlur(gray, (5,5), 0) canny = cv2.Canny(blur, 50, 150) return canny def display_lines(image, lines): line_image = np.zeros_like(image) if lines is not None: for line in lines: #print(line) x1, y1, x2, y2 = line.reshape(4) cv2.line(line_image, (x1, y1), ..
pseudo inverse Math: line fitting 만약 서로 다른 2개의 (x,y) 쌍을 가지고 있다면 아래와 같은 직선의 방정식을 계산해낼 수 있습니다. 이를 아래와 같은 매트릭스 형태로 표현할 수도 있습니다. 그런데 (x,y) 값을 2 쌍보다 더 많이 알고 있다면, 해가 구해낼 수 없게됩니다. 이를 over constraint 라고 하며, over constraint 상태에서 가장 에러가 작은 직선의 방정식을 구해내는 것을 line fitting 이라고 부릅니다. line fitting 을 하는 방법은 크게 2가지 방법이 있습니다. 첫번째는 에러를 최소화 하는 계수 a, b 를 찾기 위해 편미분을 이용하는 것이고, 두번째로는 pseudo inverse 를 이용하는 방법입니다. line fitting with diff..
MY PC에서 ROS MASTER를 통해 ethernet 연결된 Device로 접근하는 법 https://answers.ros.org/question/256070/problems-with-communication-between-multiple-machines/
쿼터니언의 이해 https://www.3dgep.com/understanding-quaternions/#Pure_Quaternions