#pragma once

#include "gauge.h"
#include <cali\areacal.h>

class GAUGE_API CEdgeGauge :	public CAreaCal
{
public:
	CEdgeGauge(void);
	virtual ~CEdgeGauge(void);
	virtual CUCObj* Clone( CUCObj* twin) ;
	virtual BOOL Serialize(HANDLE device, BOOL bIn );
	 
	//使用者不要删除
	const RvImage GetBin() {
		return m_imBin;
	}
	//本体参考点,绝对图像帧位置
	void SetCheckPosition(BOOL bCheck, RvPoint absPos);
	BOOL IsCheckPositionExist();
	RvPoint GetCheckPosition();

public:
	BOOL      m_bAntiSpur;
	BOOL      m_bFillPartHole;    // 保留

	BOOL      m_bCheckedBody;       //使用指定的物体边缘
	RvPoint   m_checkPosition;      //指定的位置(ROI图像坐标)

	int       m_nEdgeDist;
	int       m_nSpurSize ; 	

protected:
	RvImage  m_imBin;

	//BOOL    Find(RvImage image, RvMask mask, double dx, double dy, int edgeDist);
	//RvImage SelectBlobAtPos(RvImage image ,int x, int y);
	BOOL SelectBlob(RvImage image, const RvMask mask);

	//THE USER should release points(RvPoint*)
	RvPoint* SelectEdge(RvImage image, const RvMask mask, int dist, int* pSize);

	void     Preprocess(RvImage image, const RvMask mask);

	 
	
};

