Definition at line 536 of file KfrMotionExtractor.h. References DumpWeightMatrix(), m_TPLMax, m_TPLMin, m_verbose2, m_Weight, and TPL_NUM. Referenced by HandleNewFrame(). 00537 { 00538 int i=0,j=0; 00539 00540 // pan: horizontal template 00541 int base = 1; 00542 int delta = 4; 00543 for (i=0; i<bWidth; i++) 00544 for (j=0; j<bHeight; j++) 00545 { 00546 m_Weight[0][j*bWidth+i] = base + delta*i; 00547 } 00548 m_TPLMin[0] = base; 00549 m_TPLMax[0] = base + delta*(bWidth-1); 00550 00551 // tilt: vertical tempate 00552 delta = 5; 00553 for (j=0; j<bHeight; j++) 00554 for (i=0; i<bWidth; i++) 00555 { 00556 m_Weight[1][j*bWidth+i] = base + delta*j; 00557 } 00558 m_TPLMin[1] = base; 00559 m_TPLMax[1] = base + delta*(bHeight-1); 00560 00561 // zoom: radial tempate 00562 delta=16; 00563 int k=0; 00564 int dim = (bWidth<=bHeight) ? bWidth: bHeight; 00565 for (k=0; k<dim/2; k++) 00566 { 00567 // first column: left 00568 i=0+k; 00569 for (j=0+k; j<bHeight-k; j++) 00570 { 00571 m_Weight[2][j*bWidth+i] = base + delta*k; 00572 } 00573 00574 // last colum: right 00575 i=bWidth-1-k; 00576 for (j=0+k; j<bHeight-k; j++) 00577 { 00578 m_Weight[2][j*bWidth+i] = base + delta*k; 00579 } 00580 00581 // first row: top 00582 j=0+k; 00583 for (i=0+k; i<bWidth-k; i++) 00584 { 00585 m_Weight[2][j*bWidth+i] = base + delta*k; 00586 } 00587 00588 // last row: bottom 00589 j=bHeight-1-k; 00590 for (i=0+k; i<bWidth-k; i++) 00591 { 00592 m_Weight[2][j*bWidth+i] = base + delta*k; 00593 } 00594 00595 //DumpWeightMatrix(m_Weight[2], bWidth, bHeight, 2); 00596 00597 } 00598 00599 // if dim is odd, one row or one colum will NOT be process. 00600 // here, we will do this processing for the left one. 00601 m_TPLMin[2] = base; 00602 m_TPLMax[2] = base + delta*k; 00603 if (dim%2==1) 00604 { 00605 if (bWidth >= bHeight) 00606 { 00607 // middle row 00608 j=0+k; 00609 for (i=0+k; i<bWidth-k; i++) 00610 { 00611 m_Weight[2][j*bWidth+i] = base + delta*k; 00612 } 00613 } 00614 else 00615 { 00616 // middle column 00617 i=0+k; 00618 for (j=0+k; j<bHeight-k; j++) 00619 { 00620 m_Weight[2][j*bWidth+i] = base + delta*k; 00621 } 00622 } 00623 00624 //DumpWeightMatrix(m_Weight[2], bWidth, bHeight, 2); 00625 } 00626 00627 // output the weight matrix 00628 if (m_verbose2) 00629 { 00630 for (int t=0;t<TPL_NUM;t++) 00631 { 00632 DumpWeightMatrix(m_Weight[t], bWidth, bHeight, t); 00633 } 00634 } 00635 00636 }
Here is the call graph for this function:
|