Giter Site home page Giter Site logo

jimmyhhua / opencv_tutorials Goto Github PK

View Code? Open in Web Editor NEW
1.8K 27.0 439.0 118.58 MB

Opencv4.0 with python (English&中文), and will keep the update ! 👊

Home Page: https://zhuanlan.zhihu.com/c_1094607699664277504

Python 100.00%
opencv4 opencv-tutorials opencv-python

opencv_tutorials's Introduction

OpenCV 4.0 Tutorial

✒️ 中文版本

Introduction

This repository contains source code of OpenCV Tutorial application, the environment is python3.0 and opencv4.0.

Sample

  • Image load
import cv2

src = cv2.imread("test.png")
cv2.namedWindow("input", cv2.WINDOW_AUTOSIZE)
cv2.imshow("input", src)
cv2.waitKey(0)
cv2.destroyAllWindows()
  • Gray Image
gray = cv2.cvtColor(src, cv.COLOR_BGR2GRAY)

More opencv4.0 tutorials plese follow the learning road as below 👇👇👇

Learning Road ⛳️

Annotation:

  • ✔️ : Basic
  • ✏️ : Attention
  • ❣️ : Important
No Description Annotation
code_001 Load Image ✔️
code_002 Gray Image ✔️
code_003 Image Create ✔️
code_004 Pixel Read and Write ✔️
code_005 Image Pixel Arithmetic Operations ✔️
code_006 Image Pseudo-Color Enhancement ✔️
code_007 Image Pixel Operation (Logical Operation) ✔️
code_008 Image Channel Separation and Merging ✔️
code_009 Color Space Conversion ✏️
code_010 Image Pixel Value Statistics ✔️
code_011 Image Pixel Normalization ✔️
code_012 Video Read and Write ✔️
code_013 Image Flip ✔️
code_014 Image Interpolation ✔️
code_015 Draw Geometry ✔️
code_016 ROI of Image ✔️
code_017 Image Histogram ✔️
code_018 Histogram Dqualization ✏️
code_019 Histogram Comparison ✔️
code_020 Histogram Backprojection ✔️
code_021 Image Convolution ✔️
code_022 Averaging and Gaussian Blur ❣️
code_023 Median Blur ✔️
code_024 Image Noise ✔️
code_025 Smoothing Images ✔️
code_026 Gaussian Bilateral Blur ✔️
code_027 Mean-shift Blur) ✔️
code_028 Image Integral Algorithm ✔️
code_029 Fast Image Edge Filtering Algorithm ✔️
code_030 Custom Filter ✔️
code_031 Sobel Operator ✔️
code_032 More Gradient Operators ✔️
code_033 Laplace Operator ✔️
code_034 Image Sharpening ✔️
code_035 USM Sharpen Algorithm ✔️
code_036 Canny Edge Detection ❣️
code_037 Image Pyramid ✔️
code_038 Laplace Pyramid ✔️
code_039 Image Template Matching ✔️
code_040 Binary introduction ✔️
code_041 Basic Thresholding ✔️
code_042 OTSU Thresholding ✏️
code_043 TRIANGLE Thresholding ✔️
code_044 Adaptive Thresholding ✏️
code_045 Binary and Smoothing ✏️
code_046 Image Connectivity component ✔️
code_047 Image Connected component state statistics ✔️
code_048 Image Contours ❣️
code_049 Bounding Rectangle ❣️
code_050 Contour Area and Perimeter ✏️
code_051 Contour Approximation ✔️
code_052 Contour Centroid Calculate ✔️
code_053 HuMoment for Contour Matching ✔️
code_054 Contour Cricle and Ellipse fitting ✔️
code_055 Convex Hull ✏️
code_056 Fitting a Line ✔️
code_057 Point Polygon Test ✔️
code_058 The Largest Inner Circle ✔️
code_059 Hoffman Line Detection ✔️
code_060 Probability Hoffman Line Detection ❣️
code_061 Hoffman Cricle Detection ❣️
code_062 Dilation and Erosion ❣️
code_063 Structuring Element ✔️
code_064 Opening Transformation ✏️
code_065 Closing Transformation ✏️
code_066 Application of Opening and Closing Operations ✏️
code_067 Top Hat ✔️
code_068 Black Hat ✔️
code_069 Morph Gradient ✔️
code_070 Contour based on Morph Gradient ✏️
code_071 Hit and Miss ✔️
code_072 Defect Detecting-1 ✔️
code_073 Defect Detecting-2 ✔️
code_074 Extract the Maximum Contour and Coding Key Points ✔️
code_075 Image Inpainting ✔️
code_076 Perspective Transformation ✏️
code_077 Video Read, Write and Process ✏️
code_078 Identify and Track Specific Color Objects in Video ✔️
code_079 Video Analysis-Background/Foreground Extraction ✔️
code_080 Video Analysis–Background Subtraction and ROI Extraction of the Foreground ✔️
code_081 Corner Detection-Harris ✔️
code_082 Corner Detection-Shi-Tomas ✏️
code_083 Corner Detection-Sub-Pixel ✔️
code_084 Video Analysis-KLT Optical Flow-1 ✏️
code_085 Video Analysis-KLT Optical Flow-2 ✏️
code_086 Video Analysis-Dense Optical Flow ✏️
code_087 Video Analysis-Frame Difference Moving Object Analysis ✔️
code_088 Video Analysis-Meanshift ✏️
code_089 Video Analysis-CamShift ✏️
code_090 Video Analysis-Object Movement Trajectory Drawing ✔️
code_091 Object Detection-HAAR Cascade Classification ✔️
code_092 Object Detection-HAAR Feature Analysis ✔️
code_093 Object Detection-LBP Feature Analysis ✔️
code_094 ORB Feature Critical Point Detection ✏️
code_095 ORB Feature Descriptor Matching ✔️
code_096 Multiple Descriptor Matching Methods ✏️
code_097 Location of Known Objects Based on Descriptor Matches ✏️
code_098 SIFT Feature Critical Point Detection ✔️
code_099 SIFT Feature Descriptor Matching ✔️
code_100 HOG Pedestrian Detection ✔️
code_101 HOG Multiscale Detection ✏️
code_102 HOG Extract Descriptor ✔️
code_103 HOG Use Descriptors to Generate Sample Data ✔️
code_104 (Detection Case)-HOG+SVM Train ✔️
code_105 (Detection Case)-HOG+SVM Predict ✔️
code_106 AKAZE Features and Descriptors ✔️
code_107 Brisk Features and Descriptors ✔️
code_108 GFTT Detector ✔️
code_109 BLOB Feature Analysis ✔️
code_110 KMeans Data Classification ✔️
code_111 KMeans Image Segmentation ✔️
code_112 KMeans Background Change ✔️
code_113 KMeans Extract Image Color Card ✔️
code_114 KNN Classification ✔️
code_115 KNN-Train Data Save and Load ✔️
code_116 Decision Tree Algorithm ✔️
code_117 Image Mean-shift Segmentation ✔️
code_118 Grabcut-Image Segmentation ✔️
code_119 Grabcut-Background Change ✏️
code_120 Qrcode detect and decode ✏️
code_121 DNN- Read the information of each layer of the model ✔️
code_122 DNN- Realize image classification ✔️
code_123 DNN- Model runs to set the target device and compute the background ✔️
code_124 DNN- SSD Single Image Detection ✔️
code_125 DNN- SSD Real-time Video Detection ✔️
code_126 DNN- Face Detection based on Residual Network ✔️
code_127 DNN- Video Face Detection based on Residual Network ✔️
code_128 DNN- Call the Detection Model of Tensorflow ✔️
code_129 DNN- Call the Openpose Implementation Attitude Assessment ✔️
code_130 DNN- Call YOLO Object Detection Network ✔️
code_131 DNN- YOLOv3-tiny Real-time Object Detection ✔️
code_132 DNN- Single and Multiple Image Detection ✔️
code_133 DNN- Colorful Image Colorization ✔️
code_134 DNN- ENet Image Segmentation ✔️
code_135 DNN- Real-time Fast Image Style Transfer ✔️

Appendix

⛳️ The weight can be download from Google Driver:

🌱 Weight for DNN

opencv_tutorials's People

Contributors

jimmyhhua avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

opencv_tutorials's Issues

Is there any assistance needed ?

Hi everyone,
I would love to contribute to this project, however I am not sure if maintainers are still active here ... 🤔
Would appreciate your answer.

关于hog问题

我在opencv官方文档里面找到的代码是

def hog(img):
    gx = cv.Sobel(img, cv.CV_32F, 1, 0)
    gy = cv.Sobel(img, cv.CV_32F, 0, 1)
    mag, ang = cv.cartToPolar(gx, gy)
    bins = np.int32(bin_n*ang/(2*np.pi))    # quantizing binvalues in (0...16)
    bin_cells = bins[:10,:10], bins[10:,:10], bins[:10,10:], bins[10:,10:]
    mag_cells = mag[:10,:10], mag[10:,:10], mag[:10,10:], mag[10:,10:]
    hists = [np.bincount(b.ravel(), m.ravel(), bin_n) for b, m in zip(bin_cells, mag_cells)]
    hist = np.hstack(hists)     # hist is a 64 bit vector
    return hist

deskewed = [list(map(deskew,row)) for row in train_cells]
hogdata = [list(map(hog,row)) for row in deskewed]
trainData = np.float32(hogdata).reshape(-1,64)
responses = np.repeat(np.arange(10),250)[:,np.newaxis]

def get_hog_descriptor(image):
hog = cv.HOGDescriptor()
h, w = image.shape[:2]
rate = 64 / w
image = cv.resize(image, (64, np.int(rate*h)))
gray = cv.cvtColor(image, cv.COLOR_BGR2GRAY)
bg = np.zeros((128, 64), dtype=np.uint8)
bg[:,:] = 127
h, w = gray.shape
dy = (128 - h) // 2
bg[dy:h+dy,:] = gray
fv = hog.compute(bg, winStride=(8, 8), padding=(0, 0))
return fv

这两个有什么区别吗?

opencv4.0中sift问题

想知道楼主怎么解决的sift等算法在一些opencv高版本中无法使用的问题

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.