• 大小: 4.15MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-10-29
  • 语言: 其他
  • 标签:

资源简介

图像处理,其中讨论了关于物体正反面识别的一些方法

资源截图

代码片段和文件信息

// CystalizingCluster.cpp: implementation of the CCystalizingCluster class.
//
//////////////////////////////////////////////////////////////////////

#include “stdafx.h“
#include “CystalizingCluster.h“
#include “constant.h“
#include “math.h“
#define   RANDSIZE 1
#define   LOWSEEDCOUNT  10

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CCystalizingCluster::CCystalizingCluster()
{

m_lpMapHeader=NULL;m_lpImage=NULL;m_lpLowpassMap=NULL;m_lpMarkMap=NULL;
m_lpDMap=NULL;m_lpHMap=NULL;m_lpSMap=NULL;m_lpVMap=NULL;
m_lpNewEdgeChain=NULL;
m_lpOldEdgeChain=NULL;
m_dTemperature=1.0;

}

CCystalizingCluster::~CCystalizingCluster()
{

}


void CCystalizingCluster::InitData( LPBITMAPINFOHEADER lpMapHeader
                          LPBYTE lpImage
  LPBYTE lpLowpassMap
  LPBYTE lpDMap
  DWORD *lpMarkMap
  LPBYTE lpHMap
  LPBYTE lpSMap
  LPBYTE lpVMap
  LPBYTE lpNewEdgeChain
  LPBYTE  lpOldEdgeChain)
{
m_lSeedCount=0;m_lLowSeedCount=0;
m_lpMapHeader=lpMapHeader;m_lpImage=lpImage;m_lpLowpassMap=lpLowpassMap;
m_lpMarkMap=lpMarkMap;
m_lpDMap=lpDMap;m_lpHMap=lpHMap;m_lpSMap=lpSMap;
m_lpVMap=lpVMap;
m_lpNewEdgeChain=lpNewEdgeChain;
m_lpOldEdgeChain=lpOldEdgeChain;
return;
}

BOOL     CCystalizingCluster::CystalizingHS(int *seed)
{
int whijpx_maxpy_maxpx_minpy_min;
int w1w2h1h2fclasscount;
BYTE bgr;
double d1[4];
int p_xp_y;
int *oldc;

if(!m_lpMapHeader) return FALSE;

w=m_lpMapHeader->biWidth;h=m_lpMapHeader->biHeight;

m_dCostDiffMax=0.0;m_dEdgeCount=0.0;

oldc=(int *)m_lpOldEdgeChain;
*oldc=*seed;m_bPosition[0]=*seed;
*(oldc+1)=*(seed+1);m_bPosition[1]=*(seed+1);
d1[0]=(*(m_lpHMap+(*(seed+1))*w+(*seed)))/200.0;
d1[1]=(*(m_lpSMap+(*(seed+1))*w+(*seed)))/200.0;
m_lOldEdgeCount=1;m_lNewEdgeCount=0;m_lCostCount=1;
    px_max=*seed;py_max=*(seed+1);px_min=*seed;py_min=*(seed+1);
m_dBColorSum=*(m_lpImage+((*(seed+1))*w+(*seed))*BITS);
m_dGColorSum=*(m_lpImage+((*(seed+1))*w+(*seed))*BITS+1);
m_dRColorSum=*(m_lpImage+((*(seed+1))*w+(*seed))*BITS+2);
for(i=0;i<2;i++)
{
  m_dMeanCost[i]=d1[i];
  m_dSumCost[i]=d1[i];    
}
*(m_lpMarkMap+(*(seed+1))*w+(*seed))=m_lSeedCount;
while((m_lNewEdgeCount>0)||(m_lOldEdgeCount>0))
{
m_lEdgeCount=m_lOldEdgeCount;
m_lOldEdgeCount--;
p_x=*(oldc+m_lOldEdgeCount*2);
p_y=*(oldc+m_lOldEdgeCount*2+1);

for(i=0;i<2;i++)  
{
m_dMeanCost[i]=m_dSumCost[i]/m_lCostCount;
    d1[i]=m_dMeanCost[i];
}
    d1[2]=(*(m_lpHMap+p_y*w+p_x))/200.0;
    d1[3]=(*(m_lpSMap+p_y*w+p_x))/200.0;
if(ExpandingHS(p_xp_y-1d1)) 
if(py_min>(p_y-1)) py_min=p_y-1;
if(ExpandingHS(p_xp_y+1d1)

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件         18  2010-12-08 11:16  正反面识别\constant.h

     文件      12102  2010-12-08 11:16  正反面识别\CystalizingCluster.cpp

     文件       2597  2010-12-08 11:16  正反面识别\CystalizingCluster.h

     文件      19441  2010-12-08 11:16  正反面识别\Debug\CystalizingCluster.obj

     文件     135636  2010-12-08 11:16  正反面识别\Debug\Dibapi.obj

     文件          0  2010-12-08 11:16  正反面识别\Debug\Dibapi.sbr

     文件      15181  2010-12-08 11:16  正反面识别\Debug\DrawingMap.obj

     文件          0  2010-12-08 11:16  正反面识别\Debug\DrawingMap.sbr

     文件     200704  2010-12-08 11:16  正反面识别\Debug\DSCAMSDK.dll

     文件    3941376  2010-12-08 11:16  正反面识别\Debug\Identification_001.bsc

     文件     192621  2010-12-08 11:17  正反面识别\Debug\Identification_001.exe

     文件     590444  2010-12-08 11:17  正反面识别\Debug\Identification_001.ilk

     文件      15590  2010-12-08 11:17  正反面识别\Debug\Identification_001.obj

     文件    7074816  2010-12-08 11:17  正反面识别\Debug\Identification_001.pch

     文件     574464  2010-12-08 11:17  正反面识别\Debug\Identification_001.pdb

     文件       7760  2010-12-08 11:17  正反面识别\Debug\Identification_001.res

     文件          0  2010-12-08 11:17  正反面识别\Debug\Identification_001.sbr

     文件      49531  2010-12-08 11:17  正反面识别\Debug\Identification_001Dlg.obj

     文件          0  2010-12-08 11:17  正反面识别\Debug\Identification_001Dlg.sbr

     文件      28068  2010-12-08 11:17  正反面识别\Debug\ImageProcess.obj

     文件          0  2010-12-08 11:17  正反面识别\Debug\ImageProcess.sbr

     文件       6847  2010-12-08 11:17  正反面识别\Debug\Memory.obj

     文件          0  2010-12-08 11:17  正反面识别\Debug\Memory.sbr

     文件     105958  2010-12-08 11:17  正反面识别\Debug\StdAfx.obj

     文件    1375061  2010-12-08 11:17  正反面识别\Debug\StdAfx.sbr

     文件     369664  2010-12-08 11:17  正反面识别\Debug\vc60.idb

     文件     397312  2010-12-08 11:17  正反面识别\Debug\vc60.pdb

     文件      95563  2010-12-08 11:16  正反面识别\Dibapi.cpp

     文件       6981  2010-12-08 11:16  正反面识别\Dibapi.h

     文件       7649  2010-12-08 11:16  正反面识别\DrawingMap.cpp

............此处省略34个文件信息

评论

共有 条评论

相关资源