ImageProcessView.h

来源:互联网 发布:淘宝的热线电话 编辑:程序博客网 时间:2024/04/28 01:43
// ImageProcessView.h : interface of the CImageProcessView class//#pragma once#include <complex>#include "DisplayDlg.h"#include "Vfw.h"using namespace std;struct RGB{unsigned charb;unsigned charg;unsigned charr;};struct HSI{doubleHue;doubleSaturation;doubleIntensity;};struct LineInfo{CPoint pt;int num;};class CImageProcessView : public CScrollView{protected: // create from serialization onlyCImageProcessView();DECLARE_DYNCREATE(CImageProcessView)// Attributespublic:CImageProcessDoc* GetDocument() const;// Operationspublic:int lWidth;int lHeight;int lLineBytes;bool m_bDrag;CPoint m_LastStPoint;//mouse startCPoint m_LastEndPoint;//mouse movetobool m_bTwoValue;int THRESHOLD;bool m_bDWT;DisplayDlg *pDlg;bool m_bWatershedProcGetSeed;CString m_AviName;int m_AviNumFrames;int m_AviIndex;PAVISTREAM m_pAviStream;PGETFRAME m_pAviFrame;BYTE* m_AviBuff;// Overridespublic:virtual void OnDraw(CDC* pDC);  // overridden to draw this viewvirtual BOOL PreCreateWindow(CREATESTRUCT& cs);protected:virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);// Implementationpublic:virtual ~CImageProcessView();#ifdef _DEBUGvirtual void AssertValid() const;virtual void Dump(CDumpContext& dc) const;#endifprotected:void RgbtoHsi(RGB *pRgb, HSI *pHsi);void DisplayNewImg(unsigned char* lpNewImg,int Lines,int Height,CString strTitle,bool bColor=false);void GetHistgram(int* pHistgram,bool bSmooth);void Gradient(CPoint pt,double* grad,double* angle);void MeanFilter(int M,int N);void TrunMedianFilter(int M,int N);void GaussFilter(int M,int N,double Sigma);void GaussFilter(double* pData,int M,int N,double Sigma);void MedianFilter(int M,int N);void TraceEdge(int y, int x,int LowThd, unsigned char* pUnchEdge, unsigned char* pnMag);void AnisotropicDiffusion();void ZoomDblLinear(double fx, double fy);void FFT(complex<double> * TD, complex<double> * FD, int r);void IFFT(complex<double> * TD, complex<double> * FD, int r);void FFT2(complex<double> * TD, complex<double> * FD, int w,int h);void DoFFT(complex<double> * TD, complex<double> * FD, int w, int h);void DoIFFT(complex<double>* TD, complex<double>* FD, int w, int h,CString title,CPoint startP);CPoint FrequencydomainSelectarea();void DisplayFw(complex<double> * FD, int w, int h,double c,CString title);void DoDWT(int w,int h,int LEVEL);void DoIDWT(int w,int h,int LEVEL);BOOL DWTStep_1D(double* pDbSrc, int nCurLevel,int nInv, int nStep,int nSupp);void Dilation(int** S, int M, int N, int Object, int Back);void Erosion(int** S,int M,int N, int Back);void GrayDilation(int** S, int M, int N);void GrayErosion(int** S, int M, int N);int Connectedcomponents();void Distance(int * pDist);void Fixedthreshold();void MaskCount(float** H,int M,int N,bool bEdge);int Watershed(unsigned char* pMarkImg,int objectCount);void DisplayObjLabel(int objectCount);void GrayFastOperate(bool bDilate);void ReConstruction(unsigned char* lpLevel,unsigned char* lpMasked);void CImageProcessView::Swap(int* a, int* b);// Generated message map functionsprotected:DECLARE_MESSAGE_MAP()public:virtual void OnInitialUpdate();afx_msg void OnFileReOpen();afx_msg void OnUpdateFileReOpen(CCmdUI *pCmdUI);afx_msg void OnEditPaste();afx_msg void OnEditCopy();afx_msg void OnUpdateEditCopy(CCmdUI *pCmdUI);afx_msg void OnUpdateEditPaste(CCmdUI *pCmdUI);afx_msg void OnLButtonDown(UINT nFlags, CPoint point);afx_msg void OnLButtonUp(UINT nFlags, CPoint point);afx_msg void OnMouseMove(UINT nFlags, CPoint point);afx_msg void OnEditCut();afx_msg void OnUpdateEditCut(CCmdUI *pCmdUI);afx_msg void OnViewSelectareamaximum();afx_msg void OnUpdateViewSelectareamaximum(CCmdUI *pCmdUI);afx_msg void OnViewInformation();afx_msg void OnUpdateViewInformation(CCmdUI *pCmdUI);afx_msg void OnHistgramGray();afx_msg void OnUpdateHistgramGray(CCmdUI *pCmdUI);afx_msg void OnHistgramRgb();afx_msg void OnUpdateHistgramRgb(CCmdUI *pCmdUI);afx_msg void OnHistgramHsi();afx_msg void OnUpdateHistgramHsi(CCmdUI *pCmdUI);afx_msg void OnPreprocessGray();afx_msg void OnUpdatePreprocessGray(CCmdUI *pCmdUI);afx_msg void OnPreprocessPsdeocolordisplay();afx_msg void OnUpdatePreprocessPsdeocolordisplay(CCmdUI *pCmdUI);afx_msg void OnPreprocessNegativeimage();afx_msg void OnUpdatePreprocessNegativeimage(CCmdUI *pCmdUI);afx_msg void OnHistgramEqualizer();afx_msg void OnUpdateHistgramEqualizer(CCmdUI *pCmdUI);afx_msg void OnHistgramRobustnormalization();afx_msg void OnUpdateHistgramRobustnormalization(CCmdUI *pCmdUI);afx_msg void OnGammBright();afx_msg void OnUpdateGammDark(CCmdUI *pCmdUI);afx_msg void OnGammDark();afx_msg void OnUpdateGammBright(CCmdUI *pCmdUI);afx_msg void OnAddnoiseGuass();afx_msg void OnAddnoiseSaltpepper();afx_msg void OnUpdateAddnoiseGuass(CCmdUI *pCmdUI);afx_msg void OnUpdateAddnoiseSaltpepper(CCmdUI *pCmdUI);afx_msg void OnHistgramLocal();afx_msg void OnUpdateHistgramLocal(CCmdUI *pCmdUI);afx_msg void OnPreprocessLaplacesharpen();afx_msg void OnUpdatePreprocessLaplacesharpen(CCmdUI *pCmdUI);afx_msg void OnSmoothMeanfilter();afx_msg void OnUpdateSmoothMeanfilter(CCmdUI *pCmdUI);afx_msg void OnSmoothGaussfilter();afx_msg void OnUpdateSmoothGaussfilter(CCmdUI *pCmdUI);afx_msg void OnSmoothMedianfilter();afx_msg void OnUpdateSmoothMedianfilter(CCmdUI *pCmdUI);afx_msg void OnSmoothColorfilter();afx_msg void OnUpdateSmoothColorfilter(CCmdUI *pCmdUI);afx_msg void OnFrequencydomainFft();afx_msg void OnUpdateFrequencydomainFft(CCmdUI *pCmdUI);afx_msg void OnButterworthLowfilter();afx_msg void OnButterworthHighfilter();afx_msg void OnUpdateButterworthLowfilter(CCmdUI *pCmdUI);afx_msg void OnUpdateButterworthHighfilter(CCmdUI *pCmdUI);afx_msg void OnFrequencydomainHomomorphicfilter();afx_msg void OnUpdateFrequencydomainHomomorphicfilter(CCmdUI *pCmdUI);afx_msg void OnFileGetmodal();afx_msg void OnUpdateFileGetmodal(CCmdUI *pCmdUI);afx_msg void OnSpatialdomainImage();afx_msg void OnUpdateSpatialdomainImage(CCmdUI *pCmdUI);afx_msg void OnConvolutionMean();afx_msg void OnUpdateConvolutionMean(CCmdUI *pCmdUI);afx_msg void OnConvolutionGauss();afx_msg void OnUpdateConvolutionGauss(CCmdUI *pCmdUI);afx_msg void OnConvolutionLaplace();afx_msg void OnUpdateConvolutionLaplace(CCmdUI *pCmdUI);afx_msg void OnConvolutionMarr();afx_msg void OnUpdateConvolutionMarr(CCmdUI *pCmdUI);afx_msg void OnConvolutionCorrelation();afx_msg void OnUpdateConvolutionCorrelation(CCmdUI *pCmdUI);afx_msg void OnAdaptiveNoisereduction();afx_msg void OnUpdateAdaptiveNoisereduction(CCmdUI *pCmdUI);afx_msg void OnAdaptiveMedian();afx_msg void OnUpdateAdaptiveMedian(CCmdUI *pCmdUI);afx_msg void OnFrequencydomainNotchpassfilter();afx_msg void OnUpdateFrequencydomainNotchpassfilter(CCmdUI *pCmdUI);afx_msg void OnFrequencydomainOptimumnotchfilter();afx_msg void OnUpdateFrequencydomainOptimumnotchfilter(CCmdUI *pCmdUI);afx_msg void OnFrequencydomainWinnerfilter();afx_msg void OnUpdateFrequencydomainWinnerfilter(CCmdUI *pCmdUI);afx_msg void OnFrequencydomainLeastsquaresfilter();afx_msg void OnUpdateFrequencydomainLeastsquaresfilter(CCmdUI *pCmdUI);afx_msg void OnSpatialdomainGeometrictransformations();afx_msg void OnUpdateSpatialdomainGeometrictransformations(CCmdUI *pCmdUI);afx_msg void OnDwtDwt();afx_msg void OnUpdateDwtDwt(CCmdUI *pCmdUI);afx_msg void OnDwtIdwt();afx_msg void OnUpdateDwtIdwt(CCmdUI *pCmdUI);afx_msg void OnEdgeAll();afx_msg void OnUpdateEdgeAll(CCmdUI *pCmdUI);afx_msg void OnEdgeH();afx_msg void OnUpdateEdgeH(CCmdUI *pCmdUI);afx_msg void OnEdgeV();afx_msg void OnUpdateEdgeV(CCmdUI *pCmdUI);afx_msg void OnDwtSmooth();afx_msg void OnUpdateDwtSmooth(CCmdUI *pCmdUI);afx_msg void OnMorphologicalDilation();afx_msg void OnUpdateMorphologicalDilation(CCmdUI *pCmdUI);afx_msg void OnMorphologicalErosion();afx_msg void OnUpdateMorphologicalErosion(CCmdUI *pCmdUI);afx_msg void OnMorphologicalOpen();afx_msg void OnUpdateMorphologicalOpen(CCmdUI *pCmdUI);afx_msg void OnMorphologicalClose();afx_msg void OnUpdateMorphologicalClose(CCmdUI *pCmdUI);afx_msg void OnSegmentationFixedthreshold();afx_msg void OnUpdateSegmentationFixedthreshold(CCmdUI *pCmdUI);afx_msg void OnMorphologicalHitormiss();afx_msg void OnUpdateMorphologicalHitormiss(CCmdUI *pCmdUI);afx_msg void OnApplicationBoundaryextraction();afx_msg void OnUpdateApplicationBoundaryextraction(CCmdUI *pCmdUI);afx_msg void OnApplicationRegionfilling();afx_msg void OnUpdateApplicationRegionfilling(CCmdUI *pCmdUI);afx_msg void OnApplicationConnectedcomponents();afx_msg void OnUpdateApplicationConnectedcomponents(CCmdUI *pCmdUI);afx_msg void OnApplicationConvexhull();afx_msg void OnUpdateApplicationConvexhull(CCmdUI *pCmdUI);afx_msg void OnApplicationThin();afx_msg void OnUpdateApplicationThin(CCmdUI *pCmdUI);afx_msg void OnApplicationPruned();afx_msg void OnUpdateApplicationPruned(CCmdUI *pCmdUI);afx_msg void OnGrayDilation();afx_msg void OnUpdateGrayDilation(CCmdUI *pCmdUI);afx_msg void OnGrayErosion();afx_msg void OnUpdateGrayErosion(CCmdUI *pCmdUI);afx_msg void OnGrayOpen();afx_msg void OnUpdateGrayOpen(CCmdUI *pCmdUI);afx_msg void OnGrayClose();afx_msg void OnUpdateGrayClose(CCmdUI *pCmdUI);afx_msg void OnGrayGradient();afx_msg void OnUpdateGrayGradient(CCmdUI *pCmdUI);afx_msg void OnGrayTophat();afx_msg void OnUpdateGrayTophat(CCmdUI *pCmdUI);afx_msg void OnEdgeSobel();afx_msg void OnUpdateEdgeSobel(CCmdUI *pCmdUI);afx_msg void OnEdgeLaplace();afx_msg void OnUpdateEdgeLaplace(CCmdUI *pCmdUI);afx_msg void OnEdgeLog();afx_msg void OnUpdateEdgeLog(CCmdUI *pCmdUI);afx_msg void OnHoughLines();afx_msg void OnUpdateHoughLines(CCmdUI *pCmdUI);afx_msg void OnSegmentationRegiongrowing();afx_msg void OnUpdateSegmentationRegiongrowing(CCmdUI *pCmdUI);afx_msg void OnSegmentationWatershed();afx_msg void OnUpdateSegmentationWatershed(CCmdUI *pCmdUI);afx_msg void OnApplicationThinbycondition();afx_msg void OnUpdateApplicationThinbycondition(CCmdUI *pCmdUI);afx_msg void OnObjectrecognitionCorrelationmatch();afx_msg void OnUpdateObjectrecognitionCorrelationmatch(CCmdUI *pCmdUI);afx_msg void OnMorphologicalDistancetransform();afx_msg void OnUpdateMorphologicalDistancetransform(CCmdUI *pCmdUI);afx_msg void OnApplicationSeparateobject();afx_msg void OnUpdateApplicationSeparateobject(CCmdUI *pCmdUI);afx_msg void OnWatershedprocessGetseed();afx_msg void OnUpdateWatershedprocessGetseed(CCmdUI *pCmdUI);afx_msg void OnWatershedprocessLabelmarked();afx_msg void OnUpdateWatershedprocessLabelmarked(CCmdUI *pCmdUI);afx_msg void OnWatershedprocessGetareas();afx_msg void OnUpdateWatershedprocessGetareas(CCmdUI *pCmdUI);afx_msg void OnSegmentationOstu();afx_msg void OnUpdateSegmentationOstu(CCmdUI *pCmdUI);afx_msg void OnSegmentationEntropy();afx_msg void OnUpdateSegmentationEntropy(CCmdUI *pCmdUI);afx_msg void OnSegmentationMaxlikelihood();afx_msg void OnUpdateSegmentationMaxlikelihood(CCmdUI *pCmdUI);afx_msg void OnSegmentationLocalthresholding();afx_msg void OnUpdateSegmentationLocalthresholding(CCmdUI *pCmdUI);afx_msg void OnApplicationParallelthin();afx_msg void OnUpdateApplicationParallelthin(CCmdUI *pCmdUI);afx_msg void OnHoughFontofnormal();afx_msg void OnUpdateHoughFontofnormal(CCmdUI *pCmdUI);afx_msg void OnCircledetectionChordbisectionalg();afx_msg void OnUpdateCircledetectionChordbisectionalg(CCmdUI *pCmdUI);afx_msg void OnCircledetectionAcurr();afx_msg void OnUpdateCircledetectionAcurr(CCmdUI *pCmdUI);afx_msg void OnHistgramGrayBar();afx_msg void OnUpdateHistgramGrayBar(CCmdUI *pCmdUI);afx_msg void OnHistgramRgbbar();afx_msg void OnUpdateHistgramRgbbar(CCmdUI *pCmdUI);afx_msg void OnHistgramHsibar();afx_msg void OnUpdateHistgramHsibar(CCmdUI *pCmdUI);afx_msg void OnObjectrecognitionPlesseycornerdetector();afx_msg void OnUpdateObjectrecognitionPlesseycornerdetector(CCmdUI *pCmdUI);afx_msg void OnEdgeCanny();afx_msg void OnUpdateEdgeCanny(CCmdUI *pCmdUI);afx_msg void OnSegmentationOptimal();afx_msg void OnUpdateSegmentationOptimal(CCmdUI *pCmdUI);afx_msg void OnEdgeNon();afx_msg void OnUpdateEdgeNon(CCmdUI *pCmdUI);afx_msg void OnEdgeHysteresis();afx_msg void OnUpdateEdgeHysteresis(CCmdUI *pCmdUI);afx_msg void OnHoughCircle();afx_msg void OnUpdateHoughCircle(CCmdUI *pCmdUI);afx_msg void OnSegmentationDynamic();afx_msg void OnUpdateSegmentationDynamic(CCmdUI *pCmdUI);afx_msg void OnSpatialdomainZoombilinearinterpolation();afx_msg void OnUpdateSpatialdomainZoombilinearinterpolation(CCmdUI *pCmdUI);afx_msg void OnUpdateApplicationContourtrace(CCmdUI *pCmdUI);afx_msg void OnApplicationContourtrace();afx_msg void OnEdgeTrace();afx_msg void OnUpdateEdgeTrace(CCmdUI *pCmdUI);afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);afx_msg void OnSmoothTrun();afx_msg void OnUpdateSmoothTrun(CCmdUI *pCmdUI);afx_msg void OnSmoothAnisotropicdiffusion();afx_msg void OnUpdateSmoothAnisotropicdiffusion(CCmdUI *pCmdUI);afx_msg void OnGrayReconstruction();afx_msg void OnEdgeRelaxation();afx_msg void OnUpdateEdgeRelaxation(CCmdUI *pCmdUI);afx_msg void OnSegmentationBoundarytrace();afx_msg void OnUpdateSegmentationBoundarytrace(CCmdUI *pCmdUI);afx_msg void OnFileOpenavi();int LoadAvi(void);afx_msg void OnTimer(UINT_PTR nIDEvent);int GetAviNext(void);afx_msg void OnFileBmp2avi();afx_msg void OnRButtonDown(UINT nFlags, CPoint point);};#ifndef _DEBUG  // debug version in ImageProcessView.cppinline CImageProcessDoc* CImageProcessView::GetDocument() const   { return reinterpret_cast<CImageProcessDoc*>(m_pDocument); }#endif

0 0
原创粉丝点击