fiducial module - issues getting practical results
Murray Cox from Australia  [4 posts]
8 year
Hi guys,

I have a personal license and I've just bought a commercial license for a particular application involving the fiducial module, and I'm having huge problems with it. I seem to have very inconsistent performance depending on orientation and size of the fiducial within the image. I basically only get consistent performance if the marker is pretty huge and basically impractical.

Our application involves a 5MP camera (basler acA2500-14gc) 6mm focal length (approx 70 deg FOV) at ceiling height 2.7m aimed straight down. The idea is to use roborealm to identify the 2d image position and orientation of a number of fiducial markers of approximately 10cm squared in size (4 in total) which are horizontal about 30cm from the floor.

I have a set of screen captures and also direct full size image captures to show what I need and what I mean by poor performance. I've tried all sorts of different settings for the fiducial module without success. It seems to consistently draw a red box around the correct marker, which I am taking to mean that portion of the image has met the basic requirements for a fiducial, however it is not finding a match within the trained set. In all cases, the image seems clear enough for me to easily recognise the marker, however the software is mostly unable to do so - or at least is unable to do so at all orientations of the marker. When an identification is successfully made by the fiducial module, the confidence is usually high >90%, however I can then rotate the same marker on the spot and lose the recognition entirely. I have no filters set in the fiducial module that I'm aware of (orientation filtering is set to defaults of 0 to 360), and reducing the min confidence from the 70% I want to use right down does not help. I have increased the max size to a huge number (100000) to see if that was filtering with no effect.

Things I have tried :-
* adding thresholding and combinations of erode/dilate to get a fantastic looking image of the fiducial removing things like lighting reflection making laser printed blacks not as black - no benefit seemingly.
* Bigger fiducials - even really big (impractical) ones seem to have problems at certain orientations and can't consistently return a result.
* playing with the adaptive threshold number between 0 and 100 in the fiducial settings - this does seem to affect whether I get the red square around the imaged fiducial, but never seems to improve things enough to get an identification.
* fiducials with round internal markings instead of grid patterns of blocks (pattern of three white circles inside the black square) - this type of marker doesn't seem to be supported at all, couldn't get any positive result after training.
* differing amounts of white space border around the printed physical fiducial marker itself.

I have put a bunch of screen grabs, the training set and sample captured images (5MP) of what I would ideally need to be able to detect on dropbox, the link is;


To be honest I'm a bit panicked over this - I have a week to get this going, and I'm really stuck. I would be very grateful for a rapid response and some tests using the sample images. I will also post this message to the forum, so apologies for cross-posting but I'm desperate...

Murray Cox


Steven Gentner from United States  [273 posts] 8 year

Couple things to change.

1. First download the latest version as we improved the performance a bit on those images. They are larger than most of what we used to test so improving some heuristics made things work better. Then:

2. Use the attached training file. You need to ensure where is a white border around the training fiducials too. The easiest way to work with these is to work with a really small 8x8 pixel image zoomed in such that each block can be created by a single pixel. This is then easy to ensure that all blocks are the same size and that a white border can be created.

3. Increase the adaptive threshold to 40 from the default of 30 (due to larger image size).

4. Be sure in your case to not have the Color Fiducials set since you are working with B&W fiducials (regardless of the image color).

That should do it ... with those changes we are getting all your images working except for the really close thresholded ones which were just too big to work reliably.

Let me know how it goes.


Steven Gentner from United States  [273 posts] 8 year
(forgot one)

5. Adjust the focal length to 600 ... I think that's probably what you were intending to enter with 6 since that's a very rare focal length. Alternatively if you enter in 1 that will ignore that value ... but will probably not provide back the right distance values.

Murray Cox from Australia  [4 posts] 8 year
thanks Steven, seems to be working great.

The high megapixel gear is currently being shipped to the US, so I can only try on the saved sample images and a lower res webcam for live images, but it is definitely much much better.

thanks again!
Murray Cox from Australia  [4 posts] 8 year
while it is definitely working much better thanks to Steven's help, I am still having some difficulty when the fiducial markers are towards the edge of a wide angle camera image. The consistency of focus across the whole field of view is less than ideal, so I know I am really pushing what is possible. But in some images linked to below, the markers are still reasonably clear yet not getting detected. The training set is the same as what Steven prepared in his post. I did try to use the fisheye_transform to correct the distortion, but was unable to get it to produce a good squared up image of the platform in the pictures. It would probably be too slow in the real time application anyway. I'm not sure if the distortion, the clarity, or something else is the primary factor in the fiducial recognition performance.


Any further tweaking or comments would be really welcome!

Steven Gentner from United States  [273 posts] 8 year

Yea, the image needs to be corrected for that amount of distortion. The Radial module can handle that ... its a bit slow to change parameters but once set, its actually quite quick to transform the image (it caches the configuration results after parameters are changed).

Also, the image color isn't very good. The Color balance module can correct that and make white white as apposed to the brown in your images.

finally, if you can climb up that ladder again and adjust the focus that will also improve things. The images are still very blurry at the fiducial level.

Attached should fix those first 2 issues ... we can't fix the final one! That's for you to do.

Murray Cox from Australia  [4 posts] 8 year
Thanks again Steven,

The chap up a ladder is in a different country to me ;) I think the focus was difficult to get even across the entire field of view. Perhaps if we raised the camera further away we would be able to get more consistent focus within the limited depth range we need.

Thanks for the color balance/radial robo file. As you say it is probably the focus that is the issue with the one remaining fiducial not recognised. I have attached the output of the radial and colour correction still with a negative result.

I also had found that if I edit the source image and add a wider border (not exactly white, but still a solid colour) that I can get a result even with the blurred marker. See the second attachment.



This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index