Please forgive old man if this is a repost. It is definetly OT, sorry.
I finally got the user interface in decent shape and actually modified DirectShow stock filter to do some edge detecting. I sure would like to ask a ton of general questions about image processing. I used to read mail on OpenCV and that is not a forum for me - I do not asspire to write license plate recognition code in 2 lines or less of code! Right now I want to know if I need to convert my RGB bitmap to gray scale or can I just use single color to speed things up a little and still idetify moving object?
Anybody has a good reference to an active image processing forum, please? Thanks Vaclav
I think your problem is more than image processing ... to do recognition you need to know how you intend to do the pattern matching scheme and that answers what image processing you need.
For example if your matching is vector based you can easily do a single pass connected component label pass and vectorize the result rather than play with edge detectors like you have. I put up old sample code on this site to do exactly that if you want to see what that looks like
Thanks guys . Sorry for the delay, had a few honey-does to work on. I am not particular about using RGB, that is what comes out from the camera. I am sure there is a stock DirectShow filter to conwert to Y. Leon, many thanks for the CCL. You did a fantastic job documenting, one does not see such professional coding often. I got it compiled and running. So far it bombs when the row dimension goes to 2 , somewhere it gets modified and ends up as -1. I am working on that.
Thanks again. Cheers Vaclav
PS just for laughs – my “primary” application is to control model train two way “green wave”, the secondary is to identify notes on sheet and color them and eventually let the player know which note he played and …
Leon, this may be too early to ask. It appears that when the trace starts( sx,sy) on cy = 2 than when it gets back to the starting point it decrements the cy by two. Should it stay in +- 1 range? The bitmap[x][y] gets “illegal access “ = invalid pointer because there is no line 0 on it. I'll force it to stay in +-1 to see if this is the issue. Don't spent too much time on this, I am just starting and this may be false alarm. I need to stop using the live feed and use one of yours bitmaps to make sure I am not messing up something else. (But I don;t have “read from file “ filter handy for now.)
Edit The problem is with labelmap with y = -1. I should be able to find it, I probably missed something.
It's not a program issue it's a required structural issue of the raster process. You must maintain a one pixel border of background color around the image to vectorize it is covered in the reference paper. It is called a guard to stop the vectorize process going outside the area so if we use G for guard pixels and U for user bitmap image it must look like this
So hence your image must be placed starting at 1,1 and the guard pixels (background color) must be in place and you start the vectorizer at 1,1. The vectorize process searches one pixel up and across in all directions so the guard pixels are REQUIRED to stop the vectorize trying to go outside the array and definitely not optional.
You will note when I make a CCL_MAP it is always created bm.bmWidth+2, bm.bmHeight+2 to allow for the guard pixels and they are manually filled in to background color and the bitmap loaded to 1,1. Also make sure you guard pixel color is the background color and not the color you are scanning for.
Your violation error above can only come about because somehow you violated the guard pixel requirements which makes sure the raster process stays inside the array dimensions. That is the safest way to do the containment if you try limiting the array index itself you will find you have issues getting guaranteed closing of the shapes.