Image classification in video stream with contours

asked 2019-06-12 04:02:48 -0600

Please I need your help with this problem, I want to create a program to differentiate between the two forms(2 images), with a camera in real time, here are the methods. I found but I’m not sure they’re going to work because I want the detection to be feasible if the object is inclined by 90 degrees or 180 degrees by example, I have to use machine learning in this problem but I am open to any proposition, also I do not have many images in the database.

Here are the methods I found but I'm not sure they will work;

1 - Apply Canny filter to extract contours.

2 - Use a features extractors such SIFT, Fourier Descriptors, Haralick's Features, Hough Transform to extract more details which could be summarised in a short vector.

3-Then train SVM or ANN with this vector.

image description

image description

Also the backgroud of the image can change.

And thank you.

edit retag flag offensive close merge delete

Comments

I want to create a program to differentiate between the two forms

can you explain it a bit more ? what exactly is the goal here ?

berak gravatar imageberak ( 2019-06-12 04:15:36 -0600 )edit
1

The goal is to detect two cases : Open or Close

Kitnos gravatar imageKitnos ( 2019-06-12 04:18:10 -0600 )edit

Maybe contours are not the best way to solve this problem because the background changes a lot, I also tried Hough Transform to detect lines, but it's not working very well, I don't know what kind of methods I gonna use

Kitnos gravatar imageKitnos ( 2019-06-12 04:57:50 -0600 )edit

You may want to look at template matching

https://docs.opencv.org/4.0.0/df/dfb/...

It is sensitive to rotation and scale but if the camera is consistently positioned and you only care about 2 orientations, template matching may work

Chris gravatar imageChris ( 2019-06-12 10:43:25 -0600 )edit

Thank you Chris for your answer but I already tested it and it didn’t give me good results.

Kitnos gravatar imageKitnos ( 2019-06-12 10:47:06 -0600 )edit

Can you share some original images that have not been Canny filtered? I would like to see why template matching would not work here.

Chris gravatar imageChris ( 2019-06-23 08:44:13 -0600 )edit

Thank you @Chris for your help, but i give up using Template Matching, i am using HOG + SVM

Kitnos gravatar imageKitnos ( 2019-06-24 14:43:42 -0600 )edit