OpenCV 3.1.0 Cascade Classifier detectMultiScale provides inconsistent results on different machines

asked 2016-08-05 04:42:04 -0600

I am using Cascade Classifier detectMultiScale to detect text in an image. I am testing on two different machines whose configuration is listed below.

The results generated for the same images using same trained xml are different. The output vector<cv::rect> size is same always but the Rect x,y,w,h are different. Please help me figure out the reason behind this or if anyone has any pointers for similar issues faced.

System 1: intel Core i3, Windows 7 Professional, VS2013 Express Edition, OpenCV 3.1.0

System 2: intel Core i5, Windows 7 Professional, VS2013 Professional Edition, OpenCV 3.1.0

I am doing other pre-processing operations and have for sure figured out that all is well until detectMultiScale step

edit retag flag offensive close merge delete

Comments

My guess. you have TBB or OpenMP enabled on both builds. The detectMultiScale function precalculates the image pyramid, then divides all scannable areas over the availble cores. Probably some rounding errors might come around there somewhere... are the differences large?

StevenPuttemans gravatar imageStevenPuttemans ( 2016-08-05 08:27:02 -0600 )edit

Thanks @StevenPuttemans! I dont remember changing the preference to build with tbb.. it should be same as default with tbb =OFF But i will confirm it again.. The changes have been drastic for few images while few of them have minor 1-5 rows/columns off.., eg: System 1 output rectangle has 160(w)9(h) and corresponding System 2 output rectangle has 180(w)30(h)....

Param92 gravatar imageParam92 ( 2016-08-05 08:49:02 -0600 )edit

I have confirmed with TBB/openMP =OFF ,facing the issue

Param92 gravatar imageParam92 ( 2016-08-09 07:41:13 -0600 )edit

That is indeed weird. Could you supply the complete CMAKE output for both systems?

StevenPuttemans gravatar imageStevenPuttemans ( 2016-08-10 02:23:57 -0600 )edit