your motion recognition sounds really interesting and I would love to have a glance at your code or project, can you share some more information or even your project with the community?
Now to the UpdateMarker() function:
(all line numbers valid for SVN rev. 33989)
The if-Block starting in line 399 is entered when the currently checked pixel at position (variables x,y) is "detected" for the current marker (variable marker).
The marker properties set in the Block represent the following:
- Area: total amount of pixels detected for this marker
- X: Center X-position (The Average is calculated after the image loop for performance reasons by dividing through "Area")
- Y: Center Y-position (The Average is calculated after the image loop for performance reasons by dividing through "Area")
- Top, Bottom, Left, Right: The Marker outline rectangle
The code starting in line 425 is used to draw the search box for every marker. The search box is the area in which a marker
may be detected in this processing turn. When a pixel has marker colors, but lies outside of this box, it will not be detected as marker pixel.
Maybe this is the point where you can attach your modifications: create a better search box for a marker by changing the preProcessMarker() method and/or adapting the UpdateMarker code to use more intelligent search boxes. Maybe you can use non-rectangular
search boxes or use smaller search boxes...
You will have noticed in my post that there already is code to reduce the search area. You can make it shown by setting the Highlight-Property of the marker to "true". The search box is shown in thecam image with the marker representative
color. Keep in mind that this box is NOT the marker area rectangle. This can be a bit confusing...
I just added a path to the Source Code section of this project thatmodifies the Lib and demo app so the whole marker rectangle can be highlighted, not only the detected pixels. (patch #3289)