입학식이라서 갔는데 항상 그렇지만(?)
교장/교감 훈화말씀은 핵노잼 -_ㅠ
게임이라면 skip 누르라고 만든 튜토리얼이라는 느낌마저 든다.
'개소리 왈왈 > 육아관련 주저리' 카테고리의 다른 글
병원, 이발 (0) | 2024.03.16 |
---|---|
지름 (0) | 2024.03.10 |
유난히 힘든 하루 (0) | 2024.03.03 |
생일 파티 part 2 + 웹캠지름 (0) | 2024.03.02 |
생일 파티 part 1 (0) | 2024.03.01 |
입학식이라서 갔는데 항상 그렇지만(?)
교장/교감 훈화말씀은 핵노잼 -_ㅠ
게임이라면 skip 누르라고 만든 튜토리얼이라는 느낌마저 든다.
병원, 이발 (0) | 2024.03.16 |
---|---|
지름 (0) | 2024.03.10 |
유난히 힘든 하루 (0) | 2024.03.03 |
생일 파티 part 2 + 웹캠지름 (0) | 2024.03.02 |
생일 파티 part 1 (0) | 2024.03.01 |
개 두마리 씻기고
세차하고
빨래개고, 설겆이하고, 밥하고, 빨래하고
팔이 아릴 정도로 고생을 한 기분..
지름 (0) | 2024.03.10 |
---|---|
입학식 (0) | 2024.03.04 |
생일 파티 part 2 + 웹캠지름 (0) | 2024.03.02 |
생일 파티 part 1 (0) | 2024.03.01 |
주말이 짧다 (0) | 2024.02.25 |
이제와서 하다니 흑흑
소득공제 - 인적공제, 카드, 현금영수증 (총 급여액 깍기)
세액공제 - 보험, 의료, 교육 (산출 세액 깍기)
지하철 연...착? (0) | 2024.04.17 |
---|---|
ㄹ미ㅏㄴ어리ㅏㅁㄴ어리ㅏㄴㅁ어리ㅏ (0) | 2024.03.06 |
소득공제? (0) | 2024.02.13 |
으아아아아아 (0) | 2024.01.24 |
개 피곤 (0) | 2024.01.12 |
Block SCSI generic (bsg) driver (0) | 2024.04.16 |
---|---|
lsusb -v 로 본 장치(HID MT, mouse) (0) | 2024.03.08 |
btrfs fsck (0) | 2024.02.13 |
리눅스 파일 시스템 캐싱 (0) | 2024.01.09 |
multitail / tail (2) | 2023.10.18 |
contrib 패키지를 설치해주면 해결!
오늘자 기준으로 한 63MB 정도 된다. 꽤나 큰 편 인 듯
$ python3 depth.py Traceback (most recent call last): File "/home/minimonk/src/DisparityMapfromStereoPair/depth.py", line 17, in <module> right_matcher = cv.ximgproc.createRightMatcher(left_matcher); AttributeError: module 'cv2' has no attribute 'ximgproc' $ pip install opencv-contrib-python |
[링크 : https://stackoverflow.com/questions/57427233/module-cv2-cv2-has-no-attribute-ximgproc]
docker를 이용하여 python 에서 opencv 돌리기 (0) | 2024.05.08 |
---|---|
python thread event (0) | 2024.03.05 |
cv2.stereoBM + WLS (0) | 2024.02.28 |
matplotlib animation (0) | 2024.02.28 |
pip 패키지 관리 (0) | 2024.02.27 |
matplotlib을 3d로 그려보는 것 까지 통합완료. 이제 SGBM만 해보면 될 듯
WLS 필터 미적용 | WLS 필터 적용 |
![]() |
![]() |
import numpy as np
import cv2 as cv
from matplotlib import pyplot as plt
imgL = cv.imread('tsukuba_l.png', cv.IMREAD_GRAYSCALE)
imgR = cv.imread('tsukuba_r.png', cv.IMREAD_GRAYSCALE)
max_disparity=16
stereo = cv.StereoBM_create(max_disparity, blockSize=15)
disparity = stereo.compute(imgL,imgR)
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
# X, Y 좌표 생성
height, width = imgL.shape
x = np.arange(0, width, 1)
y = np.arange(0, height, 1)
x, y = np.meshgrid(x, y)
# 깊이 맵을 사용하여 Z 좌표 생성
z = disparity
# 3D 그래프에 표시
ax.plot_surface(x, y, z, cmap='viridis')
plt.show()
# WLS 필터 적용
right_matcher = cv.ximgproc.createRightMatcher(stereo);
left_disp = stereo.compute(imgL, imgR);
right_disp = right_matcher.compute(imgR, imgL);
# Now create DisparityWLSFilter
wls_filter = cv.ximgproc.createDisparityWLSFilter(stereo);
sigma = 1.5
lmbda = 8000.0
wls_filter.setLambda(lmbda);
wls_filter.setSigmaColor(sigma);
filtered_disp = wls_filter.filter(left_disp, imgL, disparity_map_right=right_disp);
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
z = filtered_disp
# 3D 그래프에 표시
ax.plot_surface(x, y, z, cmap='viridis')
plt.show()
|
python thread event (0) | 2024.03.05 |
---|---|
cv2.ximgproc 없을 경우 (0) | 2024.02.28 |
matplotlib animation (0) | 2024.02.28 |
pip 패키지 관리 (0) | 2024.02.27 |
pyhthon numpy 생략없이 출력 (0) | 2024.02.26 |
[링크 : https://matplotlib.org/stable/api/animation_api.html]
import numpy as np import matplotlib.pyplot as plt from matplotlib.animation import FuncAnimation fig, ax = plt.subplots() xdata, ydata = [], [] ln, = plt.plot([], [], 'ro') def init(): ax.set_xlim(0, 2*np.pi) ax.set_ylim(-1, 1) return ln, def update(frame): xdata.append(frame) ydata.append(np.sin(frame)) ln.set_data(xdata, ydata) return ln, ani = FuncAnimation(fig, update, frames=np.linspace(0, 2*np.pi, 128), init_func=init, blit=True) plt.show() |
[링크 : https://pythonprogramming.net/python-matplotlib-live-updating-graphs/]
[링크 : https://stackoverflow.com/questions/11874767/how-do-i-plot-in-real-time-in-a-while-loop]
+ 2024.03.14
import cv2 import matplotlib.pyplot as plt def grab_frame(cap): ret,frame = cap.read() return cv2.cvtColor(frame,cv2.COLOR_BGR2RGB) #Initiate the two cameras cap1 = cv2.VideoCapture(0) cap2 = cv2.VideoCapture(1) #create two subplots ax1 = plt.subplot(1,2,1) ax2 = plt.subplot(1,2,2) #create two image plots im1 = ax1.imshow(grab_frame(cap1)) im2 = ax2.imshow(grab_frame(cap2)) plt.ion() while True: im1.set_data(grab_frame(cap1)) im2.set_data(grab_frame(cap2)) plt.pause(0.2) plt.ioff() # due to infinite loop, this gets never called. plt.show() |
[링크 : https://stackoverflow.com/questions/44598124/update-frame-in-matplotlib-with-live-camera-preview]
matplotlib.pyplot.ion()[source] Enable interactive mode. See pyplot.isinteractive for more details. See also ioff Disable interactive mode. isinteractive Whether interactive mode is enabled. show Show all figures (and maybe block). pause Show all figures, and block for a time. |
[링크 : https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.ion.html]
cv2.ximgproc 없을 경우 (0) | 2024.02.28 |
---|---|
cv2.stereoBM + WLS (0) | 2024.02.28 |
pip 패키지 관리 (0) | 2024.02.27 |
pyhthon numpy 생략없이 출력 (0) | 2024.02.26 |
matplotlib grayscale image to 3d graph (0) | 2024.02.22 |
pip도 아래 명령들을 이용하면 현재 패키지 버전들을 저정하고, 필요한 버전들을 설치할 수 있다.
python 프로젝트들이 나중에 버전이 꼬여서 난리나는거 보면
필수적인데 왜 다들 안쓸까..
pip list pip freeze > requirements.txt |
[링크 : https://intelloper.tistory.com/53]
pip install -r requirements.txt |
cv2.stereoBM + WLS (0) | 2024.02.28 |
---|---|
matplotlib animation (0) | 2024.02.28 |
pyhthon numpy 생략없이 출력 (0) | 2024.02.26 |
matplotlib grayscale image to 3d graph (0) | 2024.02.22 |
python tcp 서버 예제 (0) | 2024.01.22 |