일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- 고정ip할당
- Google Drive API
- 아두이노 설치
- vtk
- google drive 업로드
- opencv apt설치
- opencv
- esp32
- NodeMCU
- opengl
- apt update
- libopencv-dev
- 우분투 opencv 설치
- sshkey
- annotating
- vim
- vim명령어
- opencv resize
- Winform
- ubuntu
- api사용해서 google drive에 폴더만들기
- c#
- 정보처리기사후기
- rotation
- 정보처리기사
- translation
- 아두이노
- vi
- Python
- google drive upload
- Today
- Total
목록2024/05 (9)
내가 보려고 만든 블로그
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/bX6K2h/btsHxCXClbq/ni5BLI3NEKTUg1f8BiuKTK/img.png)
1.이미지 회전rotated.pyimport cv2 # Reading the imageimage = cv2.imread('Lenna.png') # dividing height and width by 2 to get the center of the imageheight, width = image.shape[:2]# get the center coordinates of the image to create the 2D rotation matrixcenter = (width/2, height/2) # using cv2.getRotationMatrix2D() to get the rotation matrixrotate_matrix = cv2.getRotationMatrix2D(center=center, angle=..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/oXlWW/btsHx8hj7BQ/4uikraAmH0akWOFhKtHKMK/img.png)
cropped.py# Import packagesimport cv2import numpy as np img = cv2.imread('Lenna.png')print(img.shape) # Print image shapecv2.imshow("original", img) # Cropping an imagecropped_image = img[80:280, 150:330] # Display cropped imagecv2.imshow("cropped", cropped_image) # Save the cropped imagecv2.imwrite("CroppedImage.jpg", cropped_image) cv2.waitKey(0)cv2.destroyAllWindows() python3 cropped.py
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/lHg4h/btsHyCbbrkf/PbAITzeiXPf42F9dNv2U91/img.png)
resizeImg.py # let's start with the Imports import cv2import numpy as np # Read the image using imread functionimage = cv2.imread('Lenna.png')cv2.imshow('Original Image', image) # let's downscale the image using new width and heightdown_width = 300down_height = 200down_points = (down_width, down_height)resized_down = cv2.resize(image, down_points, interpolation= cv2.INTER_LINEAR) # let's upscal..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/cx7DLB/btsHxi51Lhv/eckFZdMkqpNeILEvyPDkc1/img.png)
python -VPython 3.10.12사용함 readWrite.py# import the cv2 libraryimport cv2 # The function cv2.imread() is used to read an image.img_grayscale = cv2.imread('test.jpg',0) # The function cv2.imshow() is used to display an image in a window.cv2.imshow('graycsale image',img_grayscale) # waitKey() waits for a key press to close the window and 0 specifies indefinite loopcv2.waitKey(0) # cv2.destroyAllWi..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/b6QGS3/btsHxheUv97/Hzv4EypJUjcNczGqobyHxk/img.png)
CMakeLists.txtcmake_minimum_required(VERSION 3.10)project(OpenCVExample)find_package(OpenCV REQUIRED)include_directories(${OpenCV_INCLUDE_DIRS}) add_executable(main main.cpp)target_link_libraries(main ${OpenCV_LIBS}) main.cpp#include #include int main() { // read image cv::Mat image = cv::imread("Lenna.png"); // image w,h,channel std::cout make 하고 실행하면이렇게 이미지가 잘림.
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/cbnu7G/btsHwCRkTmk/l8BkkzlkwraardTpWaezx1/img.png)
CMakeLists.txtcmake_minimum_required(VERSION 3.10)project(OpenCVExample)find_package(OpenCV REQUIRED)include_directories(${OpenCV_INCLUDE_DIRS}) add_executable(main main.cpp)target_link_libraries(main ${OpenCV_LIBS})~ main.cpp#include #include int main() { // read image cv::Mat image = cv::imread("Lenna.png"); cv::imshow("Original Image", image); // let's downscale the image using ..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/cIVESP/btsHxAkL1Nv/QxQUs1LuOBRjpmqX5qLe10/img.png)
1.CMakeLists만들기본인이 테스트 하고 싶은 경로로 가서vim CMakeLists.txt 하기 CMakeLists.txtcmake_minimum_required(VERSION 3.10)project(OpenCVExample)find_package(OpenCV REQUIRED)include_directories(${OpenCV_INCLUDE_DIRS})add_executable(main main.cpp)target_link_libraries(main ${OpenCV_LIBS}) 2.main.cpp만들기main.cpp#include #include int main() { // 이미지 읽기 cv::Mat img_color = cv::imread("Lenna.png", cv::IMREAD_COLOR); ..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/eby8xk/btsHtR1iccK/J0ETYCMztpLWsfovKjl3ik/img.png)
1.시스템 패키지 목록 업데이트sudo apt update 2.OpenCV 라이브러리 설치sudo apt install libopencv-devOpenCV와 관련된 여러 패키지를 설치할 수 있다. 3.추가 패키지 설치 sudo apt install \ libopencv-core-dev \ libopencv-imgproc-dev \ libopencv-highgui-dev \ libopencv-video-dev \ libopencv-features2d-dev \ libopencv-calib3d-dev \ libopencv-objdetect-dev \ libopencv-photo-dev \ libopencv-videoio-dev 4.OpenCV 설치 확인Open..