Home > Software engineering >  (license plate detection based on opencv) in the vc project configuration choice there is no common
(license plate detection based on opencv) in the vc project configuration choice there is no common

Time:09-23

This program is the license plate detection based on opencv, as shown in the figure below within the main function of the third power when debugging breakpoints:

A breakpoint after the screen turns to this mat. The HPP file as shown below:

I groped for a day should feel errors appear in figure 1 normalPosArea function inside, so I give bosses cut the figure of definition:


Got several days really can't find out the reason and bosses told, thank you!

CodePudding user response:

Collapsed in the pop-up dialog box, press the corresponding button to enter debugging press Alt + 7 key to view the Call Stack, namely "the Call Stack" from the inside to the following out of from the inner to outer function Call history, double-click a row to the cursor to the Call of the source code or assembly instruction, don't understand when double click on the next line, until we can read ,

Baidu search relevant keywords,

CodePudding user response:

Four teachers, a bit not understand ah zhao, their programming is weaker, press Alt + 7 not reaction, want to ask you this project in the project properties configuration choose perfect run when no common language support, want to add an interface so chose a common language support CLR, debugging results can pass, but just can't run to draw the last license plate number, say the location above the trigger a power outage, pile has been damaged,,

CodePudding user response:

The corresponding CPP function, single-step tracking debugging, behold a line error, is usually a pointer, etc. There is a problem

CodePudding user response:

http://blog.sina.com.cn/s/blog_668aae780101iou9.html

CodePudding user response:


Listen to the views of the bosses, the call stack, display errors as shown below, but their programming is weak, or is not correct, hope can help to look at the bosses, the picture is after the final figure of my BBS,
Wrong place is the function inside the for loop ends is to call for the first time the inside of the opencv inline mat: : ~ mat mat () and then call: : release. Then the pop-up pile has been damaged,

CodePudding user response:

Sometimes not to "call a function name + each parameter value, after entering the function of each parameter values, intermediate variable values, exit the function return value of preparation, return to the function to call after the function value of the parameter name + + return value" this information to write logs to a file is where no matter how to also can not find the problem, including capture all kinds of abnormal, writing log to the screen and single step or set a breakpoint or generating core or DMP file,... These methods are not! Write logs to a file reference below:
 # include & lt; stdio.h> 
#include
#include
# ifdef _MSC_VER
# pragma warning (4996) disable:
#include
#include
# the else
#include
#include
#include
# define CRITICAL_SECTION pthread_mutex_t
# define _vsnprintf vsnprintf
# endif
//the Log {
# define MAXLOGSIZE 20000000
# define MAXLINSIZE 16000
#include
#include
#include
Char logfilename1 []="MyLog1. Log";
Char logfilename2 []="MyLog2. Log";
The static char logstr [MAXLINSIZE + 1];
Char datestr [16].
Char timestr [16].
Char MSS [4].
CRITICAL_SECTION cs_log;
The FILE * flog;
# ifdef _MSC_VER
The Lock (CRITICAL_SECTION void * l) {
The EnterCriticalSection (l);
}
Void Unlock (CRITICAL_SECTION * l) {
LeaveCriticalSection (l);
}
# the else
The Lock (CRITICAL_SECTION void * l) {
Pthread_mutex_lock (l);
}
Void Unlock (CRITICAL_SECTION * l) {
Pthread_mutex_unlock (l);
}
# endif
Void LogV (const char * pszFmt, va_list argp) {
* struct tm now;
Struct timeb TB;

If (NULL==pszFmt | | 0==pszFmt [0]) return;
_vsnprintf (logstr, MAXLINSIZE pszFmt, argp);
Ftime (& amp; TB);
Now=localtime (& amp; TB. Time);
Sprintf (datestr, "% d % % 4 d - 02-02 d", now - & gt; Tm_year + 1900, now - & gt; Tm_mon + 1, now - & gt; Tm_mday);
Sprintf (timestr, "02 02 02 % d: % d: % d", now - & gt; Tm_hour, now - & gt; Tm_min, now - & gt; Tm_sec);
Sprintf (MSS, "% 3 d", TB. Millitm);
Printf (" % s % s. % s % s ", datestr, timestr, MSS, logstr);
Flog=fopen (logfilename1, "a");
If (NULL! Flog)={
Fprintf (flog, "% s % s. % s % s", datestr, timestr, MSS, logstr);
If (ftell (flog) & gt; MAXLOGSIZE) {
The fclose (flog);
If (rename (logfilename1 logfilename2)) {
Remove (logfilename2);
Rename (logfilename1 logfilename2);
}
} else {
The fclose (flog);
}
}
}
Void the Log (const char * pszFmt,... ) {
Va_list argp;

The Lock (& amp; Cs_log);
Va_start (argp, pszFmt);
LogV (pszFmt argp);
Va_end (argp);
Unlock (& amp; Cs_log);
}
//the Log}
Int main (int arg c, char * argv []) {
int i;
# ifdef _MSC_VER
InitializeCriticalSection (& amp; Cs_log);
# the else
Pthread_mutex_init (& amp; Cs_log, NULL);
# endif
for (i=0; I<10000; I++) {
The Log (" This is a Log % 4 d the from FILE: % s LINE: % d \ n ", I, a __FILE__ and __LINE__);
}
# ifdef _MSC_VER
DeleteCriticalSection (& amp; Cs_log);
# the else
Pthread_mutex_destroy (& amp; Cs_log);
# endif
Return 0;
}
//1. With the main - 79 line to add to your c or. The front of the CPP file that
//the main function of 81-86 line to add to your opening
//90-94 before the end of the line to add to your main function
//where to write the LOG modeled on line 88 write to write the LOG to file MyLog1.
in the LOG
  • Related