• 大小: 3.93MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-09-28
  • 语言: 其他
  • 标签: 纹理  

资源简介

图像处理中,纹理特征的提取 部分代码如下 // 计算纹理特征 void CTextureDlg::OnBtnComputeTexture() { double dEnergy = 0.0; double dEntropy = 0.0; double dInertiaQuadrature = 0.0; double dLocalCalm = 0.0; double dCorrelation = 0.0; double dEnergy1 = 0.0; double dEntropy1 = 0.0; double dInertiaQuadrature1= 0.0; double dLocalCalm1 = 0.0; double dCorrelation1 = 0.0; unsigned char** arLocalImage; arLocalImage = cmatrix(0, m_grayShow.FilterWindowWidth-1, 0, m_grayShow.FilterWindowWidth-1); int rolltimeH = m_grayShow.ImageHeight/m_grayShow.FilterWindowWidth; int rolltimeW = m_grayShow.ImageWidth /m_grayShow.FilterWindowWidth; int i,j; int p,q; //将图像分成若干个窗口,计算其纹理均值 for(i=0; i< rolltimeH; i++) { for(j=0; j<rolltimeW; j++) { //首先赋值给子窗口 for(p=0; p<m_grayShow.FilterWindowWidth; p++) { for(q=0; q<m_grayShow.FilterWindowWidth; q++) { arLocalImage[p][q] = m_grayShow.ImageArray[i*m_grayShow.FilterWindowWidth+p][j*m_grayShow.FilterWindowWidth+q]; } } m_grayShow.ComputeMatrix(arLocalImage, m_grayShow.FilterWindowWidth); m_grayShow.ComputeFeature(dEnergy1, dEntropy1, dInertiaQuadrature1, dCorrelation1, dLocalCalm1, m_grayShow.PMatrixH, m_grayShow.GrayLayerNum); dEnergy += dEnergy1; dEntropy += dEntropy1; dInertiaQuadrature += dInertiaQuadrature1; dCorrelation += dCorrelation1; dLocalCalm += dLocalCalm1; } } dEnergy /= (rolltimeH*rolltimeW); dEntropy /= (rolltimeH*rolltimeW); dInertiaQuadrature /= (rolltimeH*rolltimeW); dCorrelation /= (rolltimeH*rolltimeW); dLocalCalm /= (rolltimeH*rolltimeW); m_dEnergy = dEnergy; m_dEntropy = dEntropy; m_dInertiaQuadrature = dInertiaQuadrature; m_dCorrelation = dCorrelation; m_dLocalCalm = dLocalCalm; UpdateData(false); }

资源截图

代码片段和文件信息

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件     4120191  2018-08-14 09:43  图像的纹理分析应用实例.rar

评论

共有 条评论