Ask Your Question

zelade's profile - activity

2020-05-28 07:43:26 -0600 received badge  Popular Question (source)
2020-04-07 02:36:31 -0600 received badge  Famous Question (source)
2018-02-08 20:48:49 -0600 received badge  Notable Question (source)
2017-12-08 14:04:59 -0600 received badge  Student (source)
2017-08-29 01:02:08 -0600 received badge  Popular Question (source)
2017-03-29 11:13:09 -0600 asked a question detectmultiscale multiprocessing

Hello.

I have just found that detecmultiscale only seems to run on one processor core. With predict () this is apparently the same. Is it possible to split this command into several cores? This would be optimal for my implementation. Furthermore, I would be interested in whether it is possible to execute several commands parralel (eg twice the detectmultiscale with other detectors). At the moment, the real time is not that great, especially since the processor capacity is not used. I'm using Python on rpi 3.

Thanks in advance.

2017-03-24 04:57:32 -0600 commented answer HOG optimal training images

I just reshaped the features:

fd = hog(image, orientations, pixels_per_cell, ... )
fd = fd.reshape(1, -1)
pred = clf.predict(fd)

This solved the problem for me i think. Thank you for the hint.

2017-03-23 09:53:32 -0600 commented answer HOG optimal training images

I think realtime is not working well then. Okay thank you i'm trying to extract the HOG features with opencv then.

2017-03-23 08:51:24 -0600 answered a question HOG optimal training images

Okay i just made it with your steps. First i extracted the features and trained a Linear SVM Classifier.

To classify i made a python script using sliding windows and then predict the window. First i load the Classifier i created, and then i load the testimage. I downscale the image and iterate. In this iteration i use the sliding window. For each window i calculate the HOG features and use predict. The detections are stored in a list. The detector is working, but i got two problems.

First problem is, that it's very slow. Is there a alternative to sliding windows, because they are very slow? Some kind of contour detection to find the signs? The second problem is, that i receive the following DepricationWarning message:

    Traceback (most recent call last)
    File "classify.py", line 79, in <module>
    pred = clf.predict(fd)
  File "/home/pi/.virtualenvs/py2cv3/local/lib/python2.7/site-packages/sklearn/linear_model/base.py", line 336, in predict
    scores = self.decision_function(X)
  File "/home/pi/.virtualenvs/py2cv3/local/lib/python2.7/site-packages/sklearn/linear_model/base.py", line 312, in decision_function
    X = check_array(X, accept_sparse='csr')
  File "/home/pi/.virtualenvs/py2cv3/local/lib/python2.7/site-packages/sklearn/utils/validation.py", line 395, in check_array
    DeprecationWarning)
    DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.

I don't know why it does appear, but it's so annoying, because it shows up for each iteration (>100 times per image).

2017-03-22 11:51:51 -0600 received badge  Supporter (source)
2017-03-22 11:51:35 -0600 received badge  Scholar (source)
2017-03-22 10:43:40 -0600 commented answer HOG optimal training images

How do you label the negative images?

2017-03-22 08:32:06 -0600 commented answer HOG optimal training images

Thanks for the detailed answer!

2017-03-22 07:55:12 -0600 commented question HOG optimal training images

Okay I'll look at this. But if i use it as multi-class classifier, the training process differs from my variant right?

So if I understand you correctly, the first step would be to find the contours of the signs in the frame. Then in the second step i calculate the hog features of the contours (rectangles) and then use predict() to classify the sign?

2017-03-22 07:11:18 -0600 commented question HOG optimal training images

I wanto to distinguish between several signs. I'm going to learn SVM Light and compute the vector to DetectMultiScale. In my implementation i would use one detectMultiScale for each sign. But I wonder if it is still running in real time. Whats the difference beetween the two options? Or otherwise asked how is the second different from mine?

I just made a test with one street sign and it worked quiet well. I used images size 48 x 48 with a narrow edge. I used 180 pos and 4000 neg images. I have found that close signs are not recognized, is this due to the image size?

2017-03-22 06:57:24 -0600 received badge  Enthusiast
2017-03-21 08:51:23 -0600 asked a question HOG optimal training images

Hello,

im going to train a HOG descriptor on traffic signs. I wonder which pictures are best suited. How many pictures should I calculate for good results? What size should the images have and what influence does this have on the later detection? Is it good for the positive images to leave a narrow edge, so the background becomes visible? Is anyone familiar with it? I would like to estimate, before I take the photos.

Thanks in advance.

2017-03-17 11:08:23 -0600 commented answer Python training custom object detector using the HOG + Linear SVM

Thank you very much, that works. I just learned, that the parameters for the HOGDescriptor are very important. They must match perfectly, otherwise an error occurs. Thank you for your patience, i appreciate that.

2017-03-17 09:12:35 -0600 commented answer Python training custom object detector using the HOG + Linear SVM

I tried it with 64x128. Apart from this i got better results with this file: https://github.com/DaHoC/trainHOG/blob/master/main.cpp. Above you see the YAML classifier file i created with it. Now i want to use it with SVMDetector(). I imported the YAML file and extractet the Detector data, but i receive a type error.

with open('cvHOGClassifiert.yaml') as infile:
   for i in range(skip_lanes):
             _ = infile.readline()
data = yaml.load(infile)
hog.setSVMDetector(data['SVMDetector'])

TypeError: _svmdetector is not a numpy array, neither a scalar

2017-03-17 06:15:19 -0600 answered a question Python training custom object detector using the HOG + Linear SVM

I still can't run the "train_HOG.cpp" file. What images does that need? Does it only work with a specific size? I tried png images 64x128.

I also tried another programm and could generate a trained file (*.yaml), is this the right file extension? The file looks as follows:

%YAML:1.0
cvHOGClassifier: !!opencv-object-detector-hog
   winSize: [ 64, 128 ]
   blockSize: [ 16, 16 ]
   blockStride: [ 8, 8 ]
   cellSize: [ 8, 8 ]
   nbins: 9
   derivAperture: 1
   winSigma: 4.
   histogramNormType: 0
   L2HysThreshold: 2.0000000000000001e-01
   gammaCorrection: 1
   nlevels: 64
   signedGradient: 0
   SVMDetector: [ 2.09888332e-02, 1.40957851e-02, 9.92207229e-03,....
2017-03-16 10:39:49 -0600 commented question Python training custom object detector using the HOG + Linear SVM

Okay i installed trainHog as standalone and ran it like you said it in this post (http://answers.opencv.org/question/96925/how-to-use-train_hogcpp/). I got the followin error:

OpenCV Error: Assertion failed (0 <= roi.x && 0 <= roi.width && roi.x + roi.width <= m.cols && 0 <= roi.y && 0 <= roi.height && roi.y + roi.height <= m.rows) in Mat, file /home/pyimagesearch/opencv/modules/core/src/matrix.cpp, line 495 terminate called after throwing an instance of 'cv::Exception' what(): /home/pyimagesearch/opencv/modules/core/src/matrix.cpp:495: error: (-215) 0 <= roi.x && 0 <= roi.width && roi.x + roi.width <= m.cols && 0 <= roi.y && 0 <= roi.height && roi.y + roi.height <= m.rows in function Mat

Aborted (core dumped)

2017-03-16 03:16:56 -0600 commented question Python training custom object detector using the HOG + Linear SVM

I'm trying to code it myself in Python, if im successful i post the code here. Do you know, what is the Input Format for "hog.setSVMDetector(...)"? To compare and test, how can i run the Train_HOG.cpp on my raspberry pi or virtualbox?

2017-03-15 03:12:31 -0600 commented question Python training custom object detector using the HOG + Linear SVM

I´m not sure what is the best for implementation in videostreams. I made the example for the pedestrian detector: hog = cv2.HOGDescriptor(); hog.setSVMDetector( cv2.HOGDescriptor_getDefaultPeopleDetector() ). I think i want to do it this way with my objects (specific traffic signs). Back to your question i think i want to use detectMultiScale()).

2017-03-14 08:50:21 -0600 commented question Python training custom object detector using the HOG + Linear SVM

I wanted to know if it worked reliably.

2017-03-14 06:46:22 -0600 commented question Python training custom object detector using the HOG + Linear SVM

Thank you. Did you use this too?

2017-03-13 11:56:14 -0600 asked a question Python training custom object detector using the HOG + Linear SVM

Hello.

Im using Python and OpenCV on my raspberry pi 3 for some kind of object recognition. I want to do this by applying the HOG + Linear SVM framework for object detection. My problem is, that i need a dataset for training my detector.I would like to orientate on these five steps(from Pyimagesearch):

1. Extract HOG features from your positive training set.
2. Compute HOG feature vectors from your negative training set.
3. Train your Linear SVM.
4. Apply hard-negative mining.
5. Re-train your Linear SVM using the positive samples, negative samples, and hard-negative samples.
Has someone already made this and could help me? Is there some kind of documentation available? I would appreciate a step by step tutorial, but i already searched and found none.

I hope someone can help me. Kind regards.