Object Localization Using HoG (sklearn) [closed]

asked 2016-05-18 15:10:29 -0600

Taseer gravatar image

I am trying to localize number plate in an image. I am using HoG to extract the features and Linear SVM for the training purposes.

I am using the sklearn library for the above purpose, however I can not find any function to detect or localize the number plate.

Is there anyway I can do it ?

Below is the code for prediction, etc:

import cv2 
from sklearn.externals import joblib 
from skimage.feature import hog 
import numpy as np 

clf = joblib.load('trained.pkl')
img = cv2.imread('/home/taseer/Python/Image_Processing/Project/test/2.jpg',0)

features = hog(img,orientations=9, pixels_per_cell=(14, 14), cells_per_block=(1, 1), visualise=False)
pred = clf.predict(np.array(features))
print pred

cv2.imshow("img", img) 
 cv2.waitKey(0)
cv2.destroyAllWindows()
edit retag flag offensive reopen merge delete

Closed for the following reason question is off-topic or not relevant by LorenaGdL
close date 2016-05-18 15:37:00.999298

Comments

  1. This an OpenCV forum, not a sklearn one. Please, address your issue to the proper fora
  2. You seem to lack knowledge about basic machine learning strategies. Obviously, predicting over the whole test image won't give you any location at all.
  3. Your lack of knowledge is also evident taken a loook at the chosen HOG params (1 cell per block, really?). Sum up: read a lot, and then give it a try. But unless you use OpenCV machine learning functions, this is not the place to ask
LorenaGdL gravatar imageLorenaGdL ( 2016-05-18 15:32:55 -0600 )edit