|
-
Aug 2nd, 2010, 03:41 PM
#4
Re: Some logic help needed
Yeah, it made sense, but it's a tricky problem. A couple points might be of value:
There may be parts of the image that will tend to remain quite static. In your example, if the camera included a wall, that area might tend to have very low change regardless of the level of traffic. Therefore, you might look at the changes in a relatively static area.
So how do you find a static area? Perhaps you could average the values of some area of the picture such that you end up with 100x100 values rather than the total pixel count. That would be a coarse grid. Of course, you could use a finer or coarser grid to whatever size you want to work with. Next, you could retain a few of those grids in a sequence and look for the average change in value for each cell in the grid. You could do this with the whole image, too, but it would mean a ton of memory. What you would be doing would be capturing the last X grids in something like a queue (though the built in queue might not be sufficient), then getting an average of Cell Y in that queue of grids. For each cell, there would develop a range of variation. You could even calculate the Standard Deviation of values for each cell, and look for cells where the SD is quite low. When the actual value of the cell falls more than 1-2 SD from the running average for that cell, then you will have an event. I would be tempted to find a few reference cells with low SD and just watch those. If all those cells jump by a few SD in a single frame, you can be pretty sure that something happened.
My concern here would be whether the calculations can be performed fast enough. The design would require averaging pixels to form the grid, then queueing the grids to form the running averages for the cells, getting the SD, and then comparing incoming images. It could possibly be improved, as once you have the low-SD cells identified, you would only need to look at the pixels that make up those cells, and could ignore the rest for this operation. Therefore, you would have one, relatively slow, routine that set up the grids, figured out the SD for the cells in the grid, and chose a few cells to use as reference cells. After that routine was finished, the monitoring routine would take over and would only need to look at a small subset of the total image.
That's my thought on the subject.
My usual boring signature: Nothing
 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|