Ask Your Question
1

[erfilter.cpp] nfa method

asked 2015-05-18 05:59:14 -0600

mau gravatar image

File: erfilter.cpp; namespace: cv; method: NFA;

I get this syntax error on text module's compilation :

p = std::numeric_limits<double>::min();

seem to lack two variables in min() function. Could they be p and logNT?

Any help? Thanks A lot. Mau

edit retag flag offensive close merge delete

Comments

is that really the exact error msg ? which compiler / os ?

(and no, std::numeric_limits<double>::min(); is not missing anything. why do you think so ?)

berak gravatar imageberak ( 2015-05-18 06:04:05 -0600 )edit
1

Error 2 error C2589: '(': token not valid to the right '::' D:\OpenCV\opencv_contrib\modules\text\src\erfilter.cpp 1406 1 opencv_text

I have just make a little translation from italian.. Compiling with VS 2013 OpenCV 3.0

mau gravatar imagemau ( 2015-05-18 06:32:31 -0600 )edit

Thanks for you answer berak,

If I ask the definition, I get this file:

/****************************************************************************
*                                                                           *
* minwindef.h -- Basic Windows Type Definitions for minwin partition        *
*                                                                           *
* Copyright (c) Microsoft Corporation. All rights reserved.                 *
*                                                                           *
****************************************************************************/

and this definition :

#define min(a,b)            (((a) < (b)) ? (a) : (b))
mau gravatar imagemau ( 2015-05-18 08:20:46 -0600 )edit

so, question now is: why does your compiler confuse the 2 ? did you make any chages to the sample code ?

(tried with vs2008, no problem here)

berak gravatar imageberak ( 2015-05-18 08:23:46 -0600 )edit

Yes it is, I saw that the other function epsilon, does links to the right definition.. I'll try to find this mess.. thanks!

mau gravatar imagemau ( 2015-05-18 08:41:28 -0600 )edit

Dear berek, how do you configure your CMake with your "tesseract" in windows? Where did you put the dependencies file, did you add "entry path" in CMake ? Thanks for your time.

mau gravatar imagemau ( 2015-05-18 09:30:58 -0600 )edit

sorry, no real idea about tesseract ;(

but if you use cmake-gui, you'll see a lot of boxes to fill in with pathes to various tesseract / leptonica items

berak gravatar imageberak ( 2015-05-18 09:49:44 -0600 )edit

And now the question is how do you make to build module text in vs2008 without tesseract? :) What did you tried? Maybe the others modules? Sorry for this question, but as you see I'm newbie for compilation's world.

mau gravatar imagemau ( 2015-05-18 10:39:20 -0600 )edit

oh, sorry, i tried the textdetection.cpp sample (which works without having tesseract on board)

berak gravatar imageberak ( 2015-05-18 10:43:48 -0600 )edit

Hey Mau,

I am in the same error. how did u fix it?

dipesh gravatar imagedipesh ( 2015-06-08 02:59:07 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2015-06-10 02:03:10 -0600

OpenCV v3.0, VS 2013.

This error comes from the conflict of "min", and "min" is defined in both minwindef.h and limit. ("c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\limits")

So, I undefined min at minwindef.h. which is in ..\OpenCV\opencv\modules\videoio\src\precomp.hpp.

I added below lines to precomp.hpp: ..\OpenCV\opencv_contrib\modules\text\src\precomp.hpp

if defined WIN32 || defined WINCE

#if !defined _WIN32_WINNT
    #ifdef HAVE_MSMF
        #define _WIN32_WINNT 0x0600 // Windows Vista
    #else
        #define _WIN32_WINNT 0x0500 // Windows 2000
    #endif
#endif

#include <windows.h>
#undef small
#undef min
#undef max
#undef abs

endif

edit flag offensive delete link more

Comments

Thank you Turboart. I was struggling with it for a week. Now it is working fine. :)

dipesh gravatar imagedipesh ( 2015-06-10 04:00:30 -0600 )edit

@dipesh could you explain how did you fixed it? i am having the same issue :( and i havent been able to solve it.. many thanks!

aguila gravatar imageaguila ( 2016-06-28 12:34:16 -0600 )edit

@superichi , please don't post answers, if you don't have any.

berak gravatar imageberak ( 2016-06-28 21:04:29 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2015-05-18 05:59:14 -0600

Seen: 788 times

Last updated: Jun 28 '16