Unicode文字編碼為wide-encoding其中的一種規格, 而BIG-5則是所謂多位元文字編碼(Multibyte Character Set, MBCS)
// CHelloVCView 描繪
void CHelloVCView::OnDraw(CDC* pDC)
{
    CHelloVCDoc* pDoc = GetDocument();
    ASSERT_VALID(pDoc);
    if (!pDoc)
        return;
    // TODO: 在此加入原生資料的描繪程式碼
    pDC->TextOut(0, 0, L"Hello, Visual C++");
}

me1237guy 發表在 痞客邦 留言(0) 人氣()


Active Contour Model
Active Shape Model
Active Appearance Model

me1237guy 發表在 痞客邦 留言(0) 人氣()



    const int N = 20;
    double *Xa = new double[N];
    double *Ya = new double[N];
    for(int i=0; i<N; i++)
    {
         Xa[i] = i;
         Ya[i] = (rand()%10-10);
    }
    // model: y = a1*x1 + a2*x2 + a3
    CvMat *y = cvCreateMat(N, 1, CV_64FC1);
    CvMat *X = cvCreateMat(N, 3, CV_64FC1);
    CvMat *coeff = cvCreateMat(3, 1, CV_64FC1);
    // fill vector y and matrix X
    for (int i=0; i<N; ++i)
    {
        cvmSet(y, i, 0, Ya[i] );
        cvmSet(X, i, 0, 1 );
        cvmSet(X, i, 1, Xa[i] );
        cvmSet(X, i, 2, Xa[i]*Xa[i] );
    }
    
    cvSolve(X, y, coeff, CV_SVD);
    double x[3];
    for(int i=0; i<3; i++)
    {
       x[i] = cvGet2D(coeff,i,0).val[0];
       StatusBar1->Panels->Items[3+i]->Text = x[i];
    }
    Chart4->RemoveAllSeries();
    //draw points
    TPointSeries *theSeries;
    theSeries = new TPointSeries(Chart4);
    theSeries->SeriesColor = clGreen ;
    theSeries->Marks->Style = psDot;
    theSeries->ParentChart = Chart4;
    for(int j=0; j<N; ++j)
    theSeries->AddXY(Xa[j], Ya[j]);
    //Chart1->Canvas->Brush->Style = bsSolid ;
    TLineSeries *theLine;
    theLine = new TLineSeries(Chart4);
    theLine->SeriesColor = clRed;
    //theLine->LinePen->Style = psDashDot;
    //theLine->LinePen->Style = psSolid;
    //theLine->LinePen->Style = psDash;
    //theLine->LinePen->Style = psDot;
    theLine->LinePen->Style = psDashDotDot;
    //theLine->LinePen->Style = ps;
    theLine->ParentChart = Chart4;
    int xe;
    for(int j=-1; j<N; ++j)
    {
       theLine->AddXY(j, x[0]+x[1]*j + x[2]*j*j);
    }
    delete [] Xa;
    delete [] Ya;
    Chart4->SaveToBitmapFile("c:\\polyfit.jpg");

me1237guy 發表在 痞客邦 留言(0) 人氣()

  (1) Circle
    CvSize ImageSize1 = cvSize(1000,700);
    IplImage* Image1 = cvCreateImage(ImageSize1,IPL_DEPTH_8U,1);
    cvNot(Image1,Image1);
    CvPoint CircleCenter = cvPoint(500,350);
    int Radius = 300;
    CvScalar Color = CV_RGB(0,0,0);
    int Thickness = CV_FILLED;
    int Shift;
    cvCircle(Image1,CircleCenter,Radius,Color,Thickness,CV_AA,Shift);
    cvNamedWindow("Circle",1);
    cvShowImage("Circle",Image1);
    cvWaitKey(0);

me1237guy 發表在 痞客邦 留言(0) 人氣()

Blog Stats
⚠️

成人內容提醒

本部落格內容僅限年滿十八歲者瀏覽。
若您未滿十八歲,請立即離開。

已滿十八歲者,亦請勿將內容提供給未成年人士。