Ask Your Question
0

Create Mask for work only on street

asked 2014-06-20 09:05:36 -0600

henrique gravatar image

updated 2014-06-25 08:32:42 -0600

Create Mask for work only on street (I will work differently in green and red sides) details: Camera is static. I didn't finded how I would create masks with different forms (because I would have to analyze streets with different trajectories) in opencv, I use C++. see the image: image description

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
2

answered 2014-06-20 09:55:31 -0600

Is the camera static or not? If yes, just create a static mask for the line. If the camera is moving, you need to detect lines (with HOUGH transform for example and/or made a model of your road, etc.)

After that, you need to detect a car? So as you seem to have done: subtract the background (in the specified area) and compute the gravity center for the trajectory, and find the contours to see if the line is crossed.

If you need to detect precisely car (think about the shadows you have in the green area), have a look at the car detector (HAAR cascade classifier provides an already train car XML for cars detection).

edit flag offensive delete link more

Comments

Hello @Mathieu Bamachon, is Static camera, I was thinking of using cvblobslib to detect blobs, if you have any another idea share with me, Thanks and have a nice day!

henrique gravatar imagehenrique ( 2014-06-20 10:38:05 -0600 )edit

@Mathieu Barnachon how I create this Static Mask

henrique gravatar imagehenrique ( 2014-06-22 16:16:04 -0600 )edit

You could create it with an external image tool (GIMP,…) or directly in your code, anyway you want.

Mathieu Barnachon gravatar imageMathieu Barnachon ( 2014-06-23 03:13:10 -0600 )edit

@Mathieu Barnachon How can I do this in code? thanks.

henrique gravatar imagehenrique ( 2014-06-23 07:53:47 -0600 )edit

Question Tools

Stats

Asked: 2014-06-20 09:05:36 -0600

Seen: 664 times

Last updated: Jun 25 '14