Click here to Skip to main content
15,913,773 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: I need help URGENT plz Pin
David Crow24-Mar-09 6:22
David Crow24-Mar-09 6:22 
AnswerRe: I need help URGENT plz Pin
Mohamed_Khalil24-Mar-09 6:24
Mohamed_Khalil24-Mar-09 6:24 
QuestionRe: I need help URGENT plz Pin
David Crow24-Mar-09 6:37
David Crow24-Mar-09 6:37 
QuestionRe: I need help URGENT plz Pin
Mohamed_Khalil24-Mar-09 6:46
Mohamed_Khalil24-Mar-09 6:46 
AnswerRe: I need help URGENT plz Pin
David Crow24-Mar-09 6:56
David Crow24-Mar-09 6:56 
GeneralRe: I need help URGENT plz Pin
Mohamed_Khalil24-Mar-09 7:04
Mohamed_Khalil24-Mar-09 7:04 
QuestionRe: I need help URGENT plz Pin
CPallini24-Mar-09 7:03
mveCPallini24-Mar-09 7:03 
Questionhello ,my questions is about opencv track Pin
onlybluemoon24-Mar-09 5:28
onlybluemoon24-Mar-09 5:28 
I found the opencv source of cvcamshift.cpp .I have one problem of cvCamShift function in this file.That is how it change the weidth and hength and orientation .

In cvcamshift.cp:
m00 = moments.m00;
m10 = moments.m10;
m01 = moments.m01;
mu11 = moments.mu11;
mu20 = moments.mu20;
mu02 = moments.mu02;

if( fabs(m00) < DBL_EPSILON )
EXIT;

inv_m00 = 1. / m00;
xc = cvRound( m10 * inv_m00 + windowIn.x );
yc = cvRound( m01 * inv_m00 + windowIn.y );
a = mu20 * inv_m00;
b = mu11 * inv_m00;
c = mu02 * inv_m00;

/* Calculating width & height */
square = sqrt( 4 * b * b + (a - c) * (a - c) );

/* Calculating orientation */
theta = atan2( 2 * b, a - c + square );



/* Calculating width & length of figure */
cs = cos( theta );
sn = sin( theta );

rotate_a = cs * cs * mu20 + 2 * cs * sn * mu11 + sn * sn * mu02;
rotate_c = sn * sn * mu20 - 2 * cs * sn * mu11 + cs * cs * mu02;
length = sqrt( rotate_a * inv_m00 ) * 4;
width = sqrt( rotate_c * inv_m00 ) * 4;

IN a paper:(I am sorry ,It's not clear .But if you want I can send to you.)
The orientation (θ) of the major axis and the scale of the distribution are determined by finding an equivalent rectangle that has the same moments as those measured from the 2D probability distribution image (c.f. Horn, 1986). Defining the first and second moments for x and y
ΣΣ=xyyxIxM),(220
ΣΣ=xyyxIyM),(202
ΣΣ=xyyxxyIM),(11
The first two eigenvalues (the length and width of the probability distribution) are calculated in closed form as follows. From the intermediate variables a, b and c20020cxMMa−= −=ccyxMMb00112 20002cyMMc−=
We find the orientation of the equivalent rectangle −=−cab1tan21θ
The distances l1 and l2 from the distribution centroid (the dimensions of the equivalent rectangle) are given by, 2)()(221cabcal−+++= 2)()(222cabcal−+−+=
Where the extracted parameters are independent of the overall image intensity.

Thank you .I am looking forward to your answer.
AnswerRe: hello ,my questions is about opencv track Pin
CPallini24-Mar-09 7:40
mveCPallini24-Mar-09 7:40 
GeneralRe: hello ,my questions is about opencv track Pin
onlybluemoon24-Mar-09 20:29
onlybluemoon24-Mar-09 20:29 
QuestionRe: hello ,my questions is about opencv track Pin
CPallini24-Mar-09 22:15
mveCPallini24-Mar-09 22:15 
AnswerRe: hello ,my questions is about opencv track Pin
onlybluemoon25-Mar-09 2:45
onlybluemoon25-Mar-09 2:45 
GeneralRe: hello ,my questions is about opencv track Pin
onlybluemoon25-Mar-09 23:00
onlybluemoon25-Mar-09 23:00 
QuestionC++ reading out memory specs [modified] Pin
Fatbuddha 124-Mar-09 5:11
Fatbuddha 124-Mar-09 5:11 
AnswerRe: C++ reading out memory specs Pin
Michael Schubert24-Mar-09 5:23
Michael Schubert24-Mar-09 5:23 
GeneralRe: C++ reading out memory specs Pin
Fatbuddha 124-Mar-09 5:33
Fatbuddha 124-Mar-09 5:33 
GeneralRe: C++ reading out memory specs Pin
Michael Schubert24-Mar-09 5:45
Michael Schubert24-Mar-09 5:45 
GeneralRe: C++ reading out memory specs Pin
Fatbuddha 124-Mar-09 6:19
Fatbuddha 124-Mar-09 6:19 
GeneralRe: C++ reading out memory specs Pin
Michael Schubert24-Mar-09 6:28
Michael Schubert24-Mar-09 6:28 
GeneralRe: C++ reading out memory specs Pin
David Crow24-Mar-09 6:39
David Crow24-Mar-09 6:39 
AnswerRe: C++ reading out memory specs Pin
Iain Clarke, Warrior Programmer24-Mar-09 8:39
Iain Clarke, Warrior Programmer24-Mar-09 8:39 
GeneralRe: C++ reading out memory specs Pin
Fatbuddha 126-Mar-09 22:52
Fatbuddha 126-Mar-09 22:52 
Questionsegmentation fault en strcat() Pin
sankariyo24-Mar-09 4:58
sankariyo24-Mar-09 4:58 
AnswerRe: segmentation fault en strcat() Pin
Code-o-mat24-Mar-09 5:17
Code-o-mat24-Mar-09 5:17 
GeneralRe: segmentation fault en strcat() Pin
sankariyo24-Mar-09 22:26
sankariyo24-Mar-09 22:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.