标题:关于积分投影图
只看楼主
qzj19842001
Rank: 1
等 级:新手上路
帖 子:20
专家分:0
注 册:2008-7-8
结帖率:75%
 问题点数:0 回复次数:0 
关于积分投影图
我在做图像的积分投影时,得到了投影曲线。可是原始的积分投影图并不清晰,程序上怎么样修改,才能使曲线变得更加清晰?效果图,请参考附件。请各位指教,谢谢。
_分投影_.rar (8.77 KB)


程序如下:
void CHProjDlg::OnPaint()
{
    CPaintDC dc(this); // device context for painting
   
    // TODO: Add your message handler code here
    CString str;
    LONG i;
    LONG iMaxCount = 0;

///    CPaintDC dc(this);
   
    CWnd* pWnd = GetDlgItem(IDC_COORD);
    CDC* pDC = pWnd->GetDC();
    pWnd->Invalidate();
    pWnd->UpdateWindow();
    pDC->Rectangle(0,0,330,300);

    CPen* pPenRed = new CPen;
    pPenRed->CreatePen(PS_SOLID,1,RGB(255,0,0));
    CPen* pPenBlue = new CPen;
    pPenBlue->CreatePen(PS_SOLID,1,RGB(0,0,255));
    CPen* pPenGreen = new CPen;
    pPenGreen->CreatePen(PS_SOLID,1,RGB(0,255,0));

    CGdiObject* pOldPen=pDC->SelectObject(pPenRed);
    pDC->MoveTo(10,10);
    pDC->LineTo(10,280);
    pDC->LineTo(320,280);

    str.Format("0");
    pDC->TextOut(10,283,str);
    str.Format("50");
    pDC->TextOut(60,283,str);
    str.Format("100");
    pDC->TextOut(110,283,str);
    str.Format("150");
    pDC->TextOut(160,283,str);
    str.Format("200");
    pDC->TextOut(210,283,str);
    str.Format("255");
    pDC->TextOut(265,283,str);

    for(i=0; i<256; i+=5)
    {
        if((i&1) == 0)
        {
            pDC->MoveTo(i+10,280);
            pDC->LineTo(i+10,284);
        }
        else
        {
            pDC->MoveTo(i+10,280);
            pDC->LineTo(i+10,282);
        }
    }

    pDC->MoveTo(315,275);
    pDC->LineTo(320,280);
    pDC->LineTo(315,285);

    pDC->MoveTo(10,10);
    pDC->LineTo(5,15);
    pDC->MoveTo(10,10);
    pDC->LineTo(15,15);
   
    pDC->SelectObject(pPenBlue);

    for(i=0; i<m_Width; i++)
    {
        pDC->MoveTo(i+10,280);
        pDC->LineTo(i+10,281 - (int)(m_hCount[i]));
    }

    pDC->SelectObject(pOldPen);
   
    delete pPenRed;
    delete pPenBlue;
    delete pPenGreen;
    // Do not call CDialog::OnPaint() for painting messages
}
搜索更多相关主题的帖子: 投影 积分 
2009-10-05 10:37



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-287631-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.651396 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved