当前位置: 首页>>代码示例>>C++>>正文


C++ TImage::Height方法代码示例

本文整理汇总了C++中TImage::Height方法的典型用法代码示例。如果您正苦于以下问题:C++ TImage::Height方法的具体用法?C++ TImage::Height怎么用?C++ TImage::Height使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TImage的用法示例。


在下文中一共展示了TImage::Height方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: CheckPosition

void TTransRemain::CheckPosition(	TImage<unsigned char>	&srcImage,
							TImage<unsigned char >	&dstImage,
							vector<RECT>			&rectSet, 
							const	size_t			radius)
{
	TBmpInfo info;
	info.Width	(srcImage.Width());
	info.Height	(srcImage.Height());
	info.AccordMem();
	
	TBmpBoard bmpBoard;
	bmpBoard.SetBmpInfo(info);
	PixelMem *pPixel = bmpBoard.GetPixelBase();
	memcpy(pPixel, dstImage.Base(), dstImage.Width() * dstImage.Height());
	HDC memHDC = bmpBoard.GetMemDC();
	ArcTemple uptemp	= ArcCreator::CreateArc(radius, ArcTemple::eUpArc);
	ArcTemple downTemp	= ArcCreator::CreateArc(radius, ArcTemple::eDownArc);
	TPoint2D<int>	upCentre;
	TPoint2D<int>	downCentre;
	for(size_t i = 0; i < rectSet.size(); ++i)
	{
		long	upSpeciSide		= rectSet[i].top + (rectSet[i].bottom - rectSet[i].top)/3;
		long	downSpeciSide	= rectSet[i].top + (rectSet[i].bottom - rectSet[i].top)*2/3;
		TRect2D<int>	selectUpArea(rectSet[i].left, rectSet[i].top, rectSet[i].right-1, upSpeciSide);
		TRect2D<int>	selectDownArea(rectSet[i].left, downSpeciSide, rectSet[i].right, rectSet[i].bottom);
		GetTopPos(srcImage, selectUpArea, upCentre, uptemp);
		if (!selectUpArea.Within(upCentre.x(), upCentre.y()))
		{
			upCentre = selectUpArea.Center();
		}
		GetTopPos(srcImage, selectDownArea, downCentre, downTemp);
		if (!selectDownArea.Within(downCentre.x(), downCentre.y()))
		{
			downCentre = selectDownArea.Center();
		}
		
		FillDest(dstImage, upCentre, downCentre, memHDC, radius);
	}
	
	memcpy(dstImage.Base(), pPixel, dstImage.Width()* dstImage.Height());
}
开发者ID:Strongc,项目名称:my001project,代码行数:41,代码来源:TTransRemain.cpp

示例2: rgb

bool	TTransRemain::RemainCapsule	(	const TAlloc<PixelMem>	&rawImg, 
										const TImgDim			&rawImgDim, 
										TImage<PelGray8>		&remain,
										RemainParam				&remainParam,
										REMAINMODE				remainMode,
										bool					frontLight)
{
	m_mode = remainMode;
	if(rawImgDim.bytesPerPixel == 3)
	{
		TImage<PelRGB24> rgb(rawImg, rawImgDim);
		if(frontLight)	{	TImgProcess::RGBToGray (rgb, m_rawImage);	}
		else			{	TImgProcess::RGBToGray2(rgb, m_rawImage); }
	}
	else
	{
		m_rawImage.SetImage(rawImg.Base(), rawImgDim);
	}
	remain.SetZero();

	try
	{
		
		TImgProcess::BinaryGray(m_rawImage, m_binImage, remainParam.binaryLowThres, remainParam.binaryUpThres);
//		m_sortObserver.ObserverIMG(SortObserver::MAll, m_cvbProfileImg);
				
		IMG minImage = NULL; 
		FilterBoxMin(	m_binIMG,
						remainParam.minBoxWidth,
						remainParam.minBoxWidth, 
						remainParam.minBoxWidth/2, 
						remainParam.minBoxWidth/2, 
						minImage);
		unsigned char	*pImage = NULL;
		PVPAT			VPA		= NULL;
		GetImageVPA	(	minImage, 0, (void**)&pImage, &VPA);
		memcpy		(	m_minBoxImage.Base(), pImage, m_minBoxImage.Width()*m_minBoxImage.Height());
		ReleaseImage(	minImage);
		
		TImgProcess::SobelFilter(	m_rawImage,	m_sobelImage);
		CapsuleProc::ObservedIMG(SortObserver::MEnh, m_sobelIMG);
		TImgProcess::AndGrayImg	(	m_minBoxImage, m_sobelImage, m_andedImage);	

		CapsuleProc::ObservedIMG(SortObserver::MAnd, m_andedIMG);
	}
	catch (...)
	{
		static int count = 0;
		CString txt;
		txt.Format("D:\\\n%d.txt", count);
		count++;
		
		FILE* pFile = NULL;
		fopen_s(&pFile, "D:\\CatchFile.txt", "wb");
		fwrite(txt, sizeof(char), strlen(txt), pFile);
		fclose(pFile);
		return false;
	}
		
	try
	{
		WhiteBlob		(	m_binIMG, m_whiteBlob);	
		vector<RECT> rectSet = GetMouldRect(m_whiteBlob);	
		
		ExcludeEmpty	(	rectSet, remain.Height(), remain.Width());
		
		CheckPosition	(	m_andedImage, remain, rectSet, remainParam.radius);
		TImgProcess::AndGrayImg(m_rawImage, remain, remain);
	}	
	catch (...)
	{
		static int count = 0;
		CString txt;
		txt.Format("D:\\\n%d.txt", count);
		count++;

		FILE* pFile = NULL;
		fopen_s(&pFile, "D:\\CatchFile1.txt", "wb");
		fwrite(txt, sizeof(char), strlen(txt), pFile);
		fclose(pFile);
		return false;
	}
	return true;	
}
开发者ID:Strongc,项目名称:my001project,代码行数:84,代码来源:TTransRemain.cpp


注:本文中的TImage::Height方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。