Ask Your Question

Multi class SVM classifier with HOG descriptor

asked 2019-06-14 07:47:36 -0500

updated 2019-06-15 04:36:57 -0500

I created an SVM classifier with HOG (Histogram oriented Gradient) to detect a specific shape and it's working, I create positive images and negative images to use them in the detectMultiScale function.

I want to detect not only positive images, but also negative images and I can't find how to do that.

This is an example of the images I used, the goal is to detect and classify valves in two classes: Classe 1: valve closed (First image), and class 2 valve opened, I chose to use HOG + SVM because I have a lot of valves with different colors, and some valves without colors, I want to detect if the valve is open or close with a video stream.

image description image description

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2019-06-15 01:29:18 -0500

berak gravatar image

updated 2019-06-15 01:34:10 -0500

if you trained an object detection (similar to here) , you're restricted to a single object class (and negative, background images).

if you trained a multi-class classification, you don't need any "negative" images, those from the "other" classes serve that purpose.

long story short: if you want to use HOGDescriptor::detectMultiscale -- you're restricted to a single object class.

edit flag offensive delete link more


You are right, the code in your link is the code i used, do you have an idea what function i should use, and if you have a simple code or how to start this i will be very grateful, i dont know how to start, I have to train to same SVM with the 2 classifiers? or create 2 SVMs? and if I create 2 SVMs how to combine them the detect the two classes in the same image?

Kitnos gravatar imageKitnos ( 2019-06-15 03:21:01 -0500 )edit

could you provide some images to understand your problem well

sturkmen gravatar imagesturkmen ( 2019-06-15 04:19:11 -0500 )edit

sorry, but it's quite unclear, which problem you're trying to solve, based on which data.

is it even about detection ? (do you need the location ?)

berak gravatar imageberak ( 2019-06-15 04:27:28 -0500 )edit

i added some explanations, yes i want to detect the valves and their state open or close

Kitnos gravatar imageKitnos ( 2019-06-15 05:03:32 -0500 )edit

that's 2 different things at the same time.

berak gravatar imageberak ( 2019-06-15 05:09:04 -0500 )edit

but i think HOG + SVM do this, tel me if i am wrong, it save the gradient histogram and try to find a similar histogram in the input image, what i want to do is to extract HOG descriptor from database(classe 1 and Classe2) and then train SVM with this descriptors and try to find in a video block by block if it's similar to classe 1 or Classe 2 or neither classe 1 or 2

Kitnos gravatar imageKitnos ( 2019-06-15 05:25:12 -0500 )edit

@berak i dont have a lot experience in image processing do you think i am chosing a good method to resolve this problem?

Kitnos gravatar imageKitnos ( 2019-06-16 11:11:15 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2019-06-14 07:47:36 -0500

Seen: 422 times

Last updated: Jun 15 '19