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 Issues

opencv4.0中sift问题

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

关于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

这两个有什么区别吗?

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.

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.