Professional Documents
Culture Documents
Open CV Basic
Open CV Basic
Open CV Basic
Certainly! Here are some basic concepts and operations in OpenCV to help you get started:
python
Copy code
import cv2
image = cv2.imread('image.jpg')
cv2.imshow('Image', image)
cv2.waitKey(0)
cv2.destroyAllWindows()
Image Operations:
Grayscale Conversion:
python
Copy code
Resizing an Image:
python
Copy code
Image Cropping:
python
Copy code
Image Rotation:
python
Copy code
Drawing on Images:
python
Copy code
# Draw a line
# Draw a rectangle
# Draw a circle
cv2.putText(image, 'Text', (x, y), font, font_size, (blue, green, red), thickness, cv2.LINE_AA)
Image Filtering:
Applying Gaussian Blur:
python
Copy code
python
Copy code
python
Copy code
These are just a few basic operations in OpenCV to help you get started. OpenCV offers a wide range of
functionalities for advanced image and video processing tasks, including feature detection, object
recognition, contour detection, and more. The official OpenCV documentation and various online
tutorials provide detailed explanations, examples, and additional operations you can explore to expand
your knowledge of OpenCV.