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


C++ Image2D::get_numberofpixels方法代码示例

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


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

示例1: BandPass_2D

IppStatus BandPass_2D(Image2D &image_in, Image2D &image_bandpassed, const int feature_radius, const int hwhm_length)
{
	//set status variable
	IppStatus status;
	Gaussian_Kernel GaussKernel(feature_radius, hwhm_length, image_in.get_width(), image_in.get_length());
	Convolution_Kernel ConvolutionKernels(feature_radius, image_in.get_width(), image_in.get_length());
	Tophat_Kernel TopHatKernel(feature_radius, image_in.get_width(), image_in.get_length());
	int number_of_pixels = image_in.get_numberofpixels();
	int step_size = image_in.get_stepsize();

	//Create and initialize intermediate images
	Image2D image_gauss_col(image_in.get_length(), image_in.get_width());
	Image2D image_gauss_rowcol(image_in.get_length(), image_in.get_width());
	Image2D image_tophat(image_in.get_length(), image_in.get_width());

	//Gaussian kernel convolution
	status = ippiFilterColumn_32f_C1R(image_in.get_image2D() + GaussKernel.get_offset(), step_size,
		image_gauss_col.get_image2D() + GaussKernel.get_offset(), step_size,
		GaussKernel.get_ROI_size(), GaussKernel.get_gaussian_kernel(),
		GaussKernel.get_kernel_length(), GaussKernel.get_anchor_point());
	status = ippiFilterRow_32f_C1R(image_gauss_col.get_image2D() + GaussKernel.get_offset(), step_size,
		image_gauss_rowcol.get_image2D() + GaussKernel.get_offset(), step_size,
		GaussKernel.get_ROI_size(), GaussKernel.get_gaussian_kernel(),
		GaussKernel.get_kernel_length(), GaussKernel.get_anchor_point());

/*
	//tophat kernel convolution/filterbox operation
	status = ippiFilterBox_32f_C1R(image_in.get_image2D() + TopHatKernel.get_offset(), step_size,
		image_tophat.get_image2D() + TopHatKernel.get_offset(), step_size,
		TopHatKernel.get_ROI_size(), TopHatKernel.get_mask_size(),
		TopHatKernel.get_anchor_point());
*/

	//change by Eli Sloutskin: take away bias of square filtering kernel
    status = ippiConvValid_32f_C1R(image_in.get_image2D(), step_size, image_in.get_ROIfull(),
            ConvolutionKernels.get_circle_kernel(), ConvolutionKernels.get_kernel_step(), ConvolutionKernels.get_kernel_size(),
            image_tophat.get_image2D() + ConvolutionKernels.get_offset(), step_size);

    ippiDivC_32f_C1IR(3*feature_radius*feature_radius, image_tophat.get_image2D(),image_tophat.get_stepsize(),image_tophat.get_ROIfull());

	//subtract the two images
	status = ippiSub_32f_C1R(image_tophat.get_image2D() + TopHatKernel.get_offset(), step_size,
		image_gauss_rowcol.get_image2D()+TopHatKernel.get_offset(), step_size,
		image_bandpassed.get_image2D() + TopHatKernel.get_offset(), step_size,
		TopHatKernel.get_ROI_size());

	//cutoff values below zero
	status = ippiThreshold_LTVal_32f_C1IR(image_bandpassed.get_image2D() + TopHatKernel.get_offset(), step_size,
		TopHatKernel.get_ROI_size(),0,0);

	return status;
}
开发者ID:tacaswell,项目名称:PLuTARC_centerfind2D,代码行数:52,代码来源:data_proc1.cpp


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