cv2.moments() 함수는 계산된 모든 moments 값을 딕셔너리로 제공한다. 아래 코드를 보자! importcv2importnumpyasnpimg=cv2.imread('./images/golden.jpg',0)ret,thresh=cv2.threshold(img,127,255,0)contours,hierarchy=cv2.findContours(thresh,1,2)cnt=cont...
xml 수정 CMakeLists.txt 수정 노드 추가 helloword.cpp : 기본 main 코드 helloOpenCV.cpp : OpenCV 사용 코드(외부 라이브러리 적용) hellow_publisher : Node 및 spin timer 적용 hellow_publisher_class : Node 상속 클래스 적용2024...
waitKey(1) & 0xFF if c == 27: break R = cv2.getTrackbarPos("R", "rgb_palette") G = cv2.getTrackbarPos("G", "rgb_palette") B = cv2.getTrackbarPos("B", "rgb_palette") img[:] = [B, G, R] cv2.destroyAllWindows() ...