⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 zxdib.h

📁 利用web camera对目标进行特征跟踪的程序 对于初学机器视觉的有些帮助
💻 H
字号:
// ZXDib.h: interface for the CZXDib class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_ZXDIB_H__8BCD4139_996B_446F_BC26_4DBDC7FA84F1__INCLUDED_)
#define AFX_ZXDIB_H__8BCD4139_996B_446F_BC26_4DBDC7FA84F1__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class CZXDib  
{
	//自定义:
public:  
	bool CutRegionFromPicture(double *pBitmap, DWORD dwHeight, DWORD dwWidth, double *&pResult, DWORD x_from, DWORD y_from, DWORD x_to, DWORD y_to, WORD flag);
	bool RegularToGrayLevel(DWORD *pBitmap, DWORD dwHeight, DWORD dwWidth,BYTE*& pResult);
	bool RegularToGrayLevel(BYTE *pBitmap, DWORD dwHeight, DWORD dwWidth,BYTE*& pResult);
	bool SelectBiggestBlock(BYTE *pBitmap, DWORD dwHeight, DWORD dwWidth,BYTE flag,DWORD dwMinBlockSize);
	bool GetRidOfSmallBlock(BYTE *pBitmap, DWORD dwHeight, DWORD dwWidth,BYTE flag,DWORD dwMinBlockSize);
	bool SeedGrow(DWORD i,DWORD j,BYTE *pBitmap, DWORD& dwHeight, DWORD& dwWidth, DWORD& Number,BYTE& flag,BYTE& egg,WORD& Delete,BYTE* colorarray);
	bool DrawLineInTheMatric(int x_from, int y_from, int x_to, int y_to, BYTE *pBitmap,DWORD dwHeight,DWORD dwWidth,BYTE color);
	bool DrawLineInTheRGBMatric(int x_from, int y_from, int x_to, int y_to, BYTE *pBitmap,DWORD dwHeight,DWORD dwWidth,RGBQUAD color);
	bool Histogram(BYTE* pBitmap,DWORD dwHeight,DWORD dwWidth,BYTE* &pResult);
	bool Sobel(BYTE *& pImage, DWORD dwHeight, DWORD dwWidth);
	bool Sobel(BYTE * pImage, DWORD dwHeight, DWORD dwWidth,double* &pResult);
	bool GetBitmapInfo(BITMAPINFO *&bmi, CString &FileName);
	bool GetBMPFileHeader(BITMAPFILEHEADER &bfh,CString &FileName);
	bool TranslateVectorToBitmap(DWORD dwHeight,DWORD dwWidth,BYTE* pVector,BYTE*& pBitmapData,WORD flag);
	bool TranslateBitmapToVector(DWORD dwHeight,DWORD dwWidth,BYTE* pBitmapData,BYTE*& pVector,WORD flag);
	bool FindNextFileName(CString &FileName,int iStep);
	bool LoadVectorFromBMPFile(CString &FileName, BYTE *&ppBitmapData, DWORD &dwHeight, DWORD &dwWidth,WORD &flag);
	bool WriteBMPFileFromVector(CString &FileName, BYTE *pBitmapData,DWORD dwHeight,DWORD dwWidth,WORD flag);
	bool CreateBITMAPFILEHEADER(DWORD dwHeight, DWORD dwWidth, BITMAPFILEHEADER *&pBmi,WORD flag);
	bool CreateBITMAPINFO(BITMAPINFO *&pbi,DWORD dwHeight, DWORD dwWidth,WORD flag);

public:
	bool LoadEigenSpaceFromVCRFile(CString &strFileName, DWORD &dwHeight, DWORD &dwWidth, int &nTotalNumber,int nSelectPatternNumber,double* &pVector);
	bool LoadDoubleDataFromFile(CString strFileName,DWORD& dwHeight,DWORD& dwWidth,double*&pResult);
	bool WriteDoubleMatricToFile(CString strFileName, DWORD dwHeight, DWORD dwWidth,double* pMatric);
	bool NagelSimilarity(BYTE* pBitmap1,BYTE* pBitmap2,DWORD dwHeight,DWORD dwWidth,double*&pResult);
	bool CorrelationOfTwoVectors(BYTE *pBitmap1, BYTE *pBitmap2, DWORD dwHeight, DWORD dwWidth, float fFlag,float &fResult);
	bool StatisticParametersAboutMeanAndVariance(BYTE *pBitmap, DWORD dwHeight, DWORD dwWidth, float fMean[3], float fVariance[3]);
	bool StatisticParametersAboutMeanAndVariance(BYTE* pBitmap,DWORD dwHeight,DWORD dwWidth,float& fMean,float&fVariance);
	bool UnifyByMeanAndVariance(BYTE *pBitmap, DWORD dwHeight, DWORD dwWidth, float pMeanOutput[3], float pVarianceOutput[3],float pMeanInput[3],float pVarianceInput[3]);
	bool UnifyByMeanAndVariance(BYTE *pBitmap, DWORD dwHeight, DWORD dwWidth, float fMeanOutput, float fVarianceOutPut,float fMeanInput,float fVarianceInput);
	int SegmentByDownHill(BYTE* pBitmap,DWORD dwHeight,DWORD dwWidth);
	bool SegmentByOTSU(BYTE* pBitmap,DWORD dwHeight,DWORD dwWidth);
	bool VarianceByRGB2thColor(BYTE *pColorBitmap, DWORD dwHeight, DWORD dwWidth,BYTE* pBKImage, BYTE *&pResultImage);
	bool GetHSIFromRGB(BYTE *pColorBitmap, DWORD dwHeight, DWORD dwWidth, BYTE *&pResult);
	bool CoarsePositionByColorAndVariance(BYTE **pBKImage, DWORD dwHeight, DWORD dwWidth, int nBKnumber,BYTE *pBitmap, WORD flag, RECT &rect);
	bool Translate24To8Color(BYTE* pBitmap,DWORD dwHeight,DWORD dwWidth,BYTE* &pResult);
	bool CutRegionFromPicture(BYTE* pBitmap,DWORD dwHeight,DWORD dwWidth,BYTE*& pResult,DWORD x_from,DWORD y_from,DWORD x_to,DWORD y_to,WORD flag);
	bool CoarsePositionByColorSegment(BYTE* pBitmap,DWORD dwHeight,DWORD dwWidth,RECT& rect);
	bool Uncover2ValueImageByRect(BYTE *pBitmap, DWORD dwHeight, DWORD dwWidth,DWORD dwRectHeight,DWORD dwRectWidth);
	bool ColorBasedSegment(BYTE* pColorBitmap,DWORD dwHeight,DWORD dwWidth,BYTE* &pResult);
	bool CoarsePositionByMeanAndVariance(BYTE **pBKmage, DWORD dwHeight, DWORD dwWidth, int nNumberBK, BYTE *pInputImage,RECT &rect,WORD flag);
	bool VarianceImage(BYTE **ppBitmap, DWORD dwHeight, DWORD dwWidth,int nFileNumber, BYTE *pMeanImage, BYTE *&pResultImage,WORD flag);
	bool VarianceImage(BYTE *ppBitmap, DWORD dwHeight, DWORD dwWidth,BYTE *pMeanImage, BYTE *&pResultImage,WORD flag);
	bool MeanImage(BYTE **pBitmap, DWORD dwHeight, DWORD dwWidth, int nNumber, BYTE *&pResult,WORD flag);
	bool RegularToGrayLevel(double *pBitmap, DWORD dwHeight, DWORD dwWidth,BYTE*& pResult);
	bool ProjectAndFindTargetRegion(BYTE* pBitmap,DWORD dwHeight,DWORD dwWidth,RECT &rect);
	bool Cover2ValueImageByRect(BYTE *pBitmap, DWORD dwHeight, DWORD dwWidth,DWORD dwRectHeight,DWORD dwRectWidth);
	bool BlackAndWhite(BYTE* pBitmap,DWORD dwHeight,DWORD dwWidth,unsigned char flag);
	bool HistogramSmoothBy5Points(BYTE *pHg,int level=256);
	bool HistogramSmoothBy5Points(DWORD *pHg,int level);
	bool TranslateHistogramToVector(BYTE* pHg,BYTE* &pResult);
	
	CZXDib();
	virtual ~CZXDib();

};

#endif // !defined(AFX_ZXDIB_H__8BCD4139_996B_446F_BC26_4DBDC7FA84F1__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -