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


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

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


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

示例1: ApplyLowPass

Image2DPtr HighPassFilter::ApplyLowPass(const Image2DCPtr &image, const Mask2DCPtr &mask)
{
	initializeKernel();
	Image2DPtr
		outputImage = Image2D::CreateUnsetImagePtr(image->Width(), image->Height()),
		weights = Image2D::CreateUnsetImagePtr(image->Width(), image->Height());
	setFlaggedValuesToZeroAndMakeWeightsSSE(image, outputImage, mask, weights);
	applyLowPassSSE(outputImage);
	applyLowPassSSE(weights);
	elementWiseDivideSSE(outputImage, weights);
	weights.reset();
	return outputImage;
}
开发者ID:saiyanprince,项目名称:pyimager,代码行数:13,代码来源:highpassfilter.cpp

示例2: PlotPowerSNR

void RFIGuiController::PlotPowerSNR()
{
	Image2DCPtr
		image = ActiveData().GetSingleImage(),
		model = RevisedData().GetSingleImage();
	if(IsImageLoaded())
	{
		Plot2D &plot = _plotManager->NewPlot2D("SNR spectrum");
		plot.SetLogarithmicYAxis(true);

		Mask2DPtr mask =
			Mask2D::CreateSetMaskPtr<false>(image->Width(), image->Height());
		Plot2DPointSet &totalPlot = plot.StartLine("Total");
		RFIPlots::MakeSNRSpectrumPlot(totalPlot, image, model, mask);

		mask = Mask2D::CreateCopy(ActiveData().GetSingleMask());
		if(!mask->AllFalse())
		{
			Plot2DPointSet &uncontaminatedPlot = plot.StartLine("Uncontaminated");
			RFIPlots::MakeSNRSpectrumPlot(uncontaminatedPlot, image, model, mask);
	
			mask->Invert();
			Plot2DPointSet &rfiPlot = plot.StartLine("RFI");
			RFIPlots::MakeSNRSpectrumPlot(rfiPlot, image, model, mask);
		}

		_plotManager->Update();
	}
}
开发者ID:pkgw,项目名称:aoflagger,代码行数:29,代码来源:rfiguicontroller.cpp

示例3: PlotPowerTime

void RFIGuiController::PlotPowerTime()
{
	if(IsImageLoaded())
	{
		Plot2D &plot = _plotManager->NewPlot2D("Power over time");
		plot.SetLogarithmicYAxis(true);

		TimeFrequencyData activeData = ActiveData();
		Image2DCPtr image = activeData.GetSingleImage();
		Mask2DPtr mask =
			Mask2D::CreateSetMaskPtr<false>(image->Width(), image->Height());
		Plot2DPointSet &totalPlot = plot.StartLine("Total");
		RFIPlots::MakePowerTimePlot(totalPlot, image, mask, MetaData());

		mask = Mask2D::CreateCopy(activeData.GetSingleMask());
		if(!mask->AllFalse())
		{
			Plot2DPointSet &uncontaminatedPlot = plot.StartLine("Uncontaminated");
			RFIPlots::MakePowerTimePlot(uncontaminatedPlot, image, mask, MetaData());
	
			mask->Invert();
			Plot2DPointSet &rfiPlot = plot.StartLine("RFI");
			RFIPlots::MakePowerTimePlot(rfiPlot, image, mask, MetaData());
		}

		_plotManager->Update();
	}
}
开发者ID:pkgw,项目名称:aoflagger,代码行数:28,代码来源:rfiguicontroller.cpp

示例4: PlotPowerRMS

void RFIGuiController::PlotPowerRMS()
{
	if(IsImageLoaded())
	{
		Plot2D &plot = _plotManager->NewPlot2D("Spectrum RMS");
		plot.SetLogarithmicYAxis(true);

		TimeFrequencyData activeData = ActiveData();
		Image2DCPtr image = activeData.GetSingleImage();
		Mask2DPtr mask =
			Mask2D::CreateSetMaskPtr<false>(image->Width(), image->Height());
		Plot2DPointSet &beforeSet = plot.StartLine("Before");
		RFIPlots::MakeRMSSpectrumPlot(beforeSet, image, mask);

		mask = Mask2D::CreateCopy(activeData.GetSingleMask());
		if(!mask->AllFalse())
		{
			Plot2DPointSet &afterSet = plot.StartLine("After");
			RFIPlots::MakeRMSSpectrumPlot(afterSet, image, mask);
	
			//mask->Invert();
			//Plot2DPointSet &rfiSet = plot.StartLine("RFI");
			//RFIPlots::MakeRMSSpectrumPlot(rfiSet, _timeFrequencyWidget.Image(), mask);
		}

		_plotManager->Update();
	}
}
开发者ID:pkgw,项目名称:aoflagger,代码行数:28,代码来源:rfiguicontroller.cpp

示例5: Write

void Compress::Write(std::ofstream &stream, Image2DCPtr image, Mask2DCPtr mask)
{
	const num_t
		max = ThresholdTools::MaxValue(image, mask),
		min = ThresholdTools::MinValue(image, mask),
		mid = (min + max) / 2.0;
	const num_t normalizeFactor = (num_t) ((2<<22) + ((2<<22)-1)) / (max - min);
	const uint32_t
		width = image->Width(),
		height = image->Height();
	const char mode = 0;

	stream.write(reinterpret_cast<const char*>(&max), sizeof(max));
	stream.write(reinterpret_cast<const char*>(&min), sizeof(min));
	stream.write(reinterpret_cast<const char*>(&width), sizeof(width));
	stream.write(reinterpret_cast<const char*>(&height), sizeof(height));
	stream.write(&mode, sizeof(mode));

	for(unsigned y=0;y<height;++y)
	{
		for(unsigned x=0;x<width;++x)
		{
			if(!mask->Value(x, y))
			{
				int32_t value = (int32_t) round((image->Value(x, y) - mid) * normalizeFactor);
				stream.write(reinterpret_cast<char*>(&value)+1, 3);
			}
		}
	}
}
开发者ID:pkgw,项目名称:aoflagger,代码行数:30,代码来源:compress.cpp

示例6: sumAutoCorrelations

	num_t SpatialCompositionAction::sumAutoCorrelations(Image2DCPtr image) const
	{
		num_t sum = 0;
		for(size_t y=0;y<image->Height();++y)
		{
			sum += image->Value(y, y);
		}
		return sum;
	}
开发者ID:pkgw,项目名称:aoflagger,代码行数:9,代码来源:spatialcompositionaction.cpp

示例7: sumCrossCorrelations

	num_t SpatialCompositionAction::sumCrossCorrelations(Image2DCPtr image) const
	{
		num_t sum = 0;
		for(size_t y=0;y<image->Height();++y)
		{
			for(size_t x=0;x<y;++x)
				sum += image->Value(x, y);
		}
		return sum;
	}
开发者ID:pkgw,项目名称:aoflagger,代码行数:10,代码来源:spatialcompositionaction.cpp

示例8: Perform

	void ImagerAction::Perform(ArtifactSet &artifacts, ProgressListener &progress)
	{
		boost::mutex::scoped_lock lock(_imagerMutex);
		UVImager *imager = artifacts.Imager();
		if(imager == 0)
			throw BadUsageException("No imager available to create image.");
		TimeFrequencyData &data = artifacts.ContaminatedData();
		TimeFrequencyMetaDataCPtr metaData = artifacts.MetaData();
		if(data.PolarisationCount() > 1)
		{
			TimeFrequencyData *tmp = data.CreateTFData(StokesIPolarisation);
			data = *tmp;
			delete tmp;
		}
		
		bool btPlaneImager = true;
		if(btPlaneImager)
		{
			typedef double ImagerNumeric;
			BaselineTimePlaneImager<ImagerNumeric> btImager;
			BandInfo band = metaData->Band();
			Image2DCPtr
				inputReal = data.GetRealPart(),
				inputImag = data.GetImaginaryPart();
			Mask2DCPtr mask = data.GetSingleMask();
			size_t width = inputReal->Width();
			
			for(size_t t=0;t!=width;++t)
			{
				UVW uvw = metaData->UVW()[t];
				size_t channelCount = inputReal->Height();
				std::vector<std::complex<ImagerNumeric> > data(channelCount);
				for(size_t ch=0;ch!=channelCount;++ch) {
					if(mask->Value(t, ch))
						data[ch] = std::complex<ImagerNumeric>(0.0, 0.0);
					else
						data[ch] = std::complex<ImagerNumeric>(inputReal->Value(t, ch), inputImag->Value(t, ch));
				}
				
				btImager.Image(uvw.u, uvw.v, uvw.w, band.channels[0].frequencyHz, band.channels[1].frequencyHz-band.channels[0].frequencyHz, channelCount, &(data[0]), imager->FTReal());
			}
		} else {
			progress.OnStartTask(*this, 0, 1, "Imaging baseline");
			for(size_t y=0;y<data.ImageHeight();++y)
			{
				imager->Image(data, metaData, y);
				progress.OnProgress(*this, y, data.ImageHeight());
			}
			progress.OnEndTask(*this);
		}
	}
开发者ID:pkgw,项目名称:aoflagger,代码行数:51,代码来源:imageraction.cpp

示例9: VerticalSumThreshold

void ThresholdMitigater::VerticalSumThreshold(Image2DCPtr input, Mask2DPtr mask, num_t threshold)
{
	if(Length <= input->Height())
	{
		size_t height = input->Height()-Length+1; 
		for(size_t y=0;y<height;++y) {
			for(size_t x=0;x<input->Width();++x) {
				num_t sum = 0.0;
				size_t count = 0;
				for(size_t i=0;i<Length;++i) {
					if(!mask->Value(x, y+i)) {
						sum += input->Value(x, y + i);
						count++;
					}
				}
				if(count>0 && fabs(sum/count) > threshold) {
					for(size_t i=0;i<Length;++i)
					mask->SetValue(x, y + i, true);
				}
			}
		}
	}
}
开发者ID:pkgw,项目名称:aoflagger,代码行数:23,代码来源:thresholdmitigater.cpp

示例10: setFlaggedValuesToZeroAndMakeWeights

void HighPassFilter::setFlaggedValuesToZeroAndMakeWeights(const Image2DCPtr &inputImage, const Image2DPtr &outputImage, const Mask2DCPtr &inputMask, const Image2DPtr &weightsOutput)
{
	const size_t width = inputImage->Width();
	for(size_t y=0;y<inputImage->Height();++y)
	{
		for(size_t x=0;x<width;++x)
		{
			if(inputMask->Value(x, y) || !isfinite(inputImage->Value(x, y)))
			{
				outputImage->SetValue(x, y, 0.0);
				weightsOutput->SetValue(x, y, 0.0);
			} else {
				outputImage->SetValue(x, y, inputImage->Value(x, y));
				weightsOutput->SetValue(x, y, 1.0);
			}
		}
	}
}
开发者ID:saiyanprince,项目名称:pyimager,代码行数:18,代码来源:highpassfilter.cpp

示例11: HorizontalVarThreshold

void ThresholdMitigater::HorizontalVarThreshold(Image2DCPtr input, Mask2DPtr mask, size_t length, num_t threshold)
{
	size_t width = input->Width()-length+1;
	for(size_t y=0;y<input->Height();++y) {
		for(size_t x=0;x<width;++x) {
			bool flag = true;
			for(size_t i=0;i<length;++i) {
				if(input->Value(x+i, y) < threshold && input->Value(x+i, y) > -threshold) {
					flag = false;
					break;
				}
			}
			if(flag) {
				for(size_t i=0;i<length;++i)
					mask->SetValue(x + i, y, true);
			}
		}
	}
}
开发者ID:pkgw,项目名称:aoflagger,代码行数:19,代码来源:thresholdmitigater.cpp

示例12: VerticalVarThreshold

void ThresholdMitigater::VerticalVarThreshold(Image2DCPtr input, Mask2DPtr mask, size_t length, num_t threshold)
{
	size_t height = input->Height()-length+1; 
	for(size_t y=0;y<height;++y) {
		for(size_t x=0;x<input->Width();++x) {
			bool flag = true;
			for(size_t i=0;i<length;++i) {
				if(input->Value(x, y+i) <= threshold && input->Value(x, y+i) >= -threshold) {
					flag = false;
					break;
				}
			}
			if(flag) {
				for(size_t i=0;i<length;++i)
					mask->SetValue(x, y + i, true);
			}
		}
	}
}
开发者ID:pkgw,项目名称:aoflagger,代码行数:19,代码来源:thresholdmitigater.cpp

示例13: setFlaggedValuesToZeroAndMakeWeightsSSE

void HighPassFilter::setFlaggedValuesToZeroAndMakeWeightsSSE(const Image2DCPtr &inputImage, const Image2DPtr &outputImage, const Mask2DCPtr &inputMask, const Image2DPtr &weightsOutput)
{
	const size_t width = inputImage->Width();
	const __m128i zero4i = _mm_set_epi32(0, 0, 0, 0);
	const __m128 zero4 = _mm_set_ps(0.0, 0.0, 0.0, 0.0);
	const __m128 one4 = _mm_set_ps(1.0, 1.0, 1.0, 1.0);
	for(size_t y=0;y<inputImage->Height();++y)
	{
		const bool *rowPtr = inputMask->ValuePtr(0, y);
		const float *inputPtr = inputImage->ValuePtr(0, y);
		float *outputPtr = outputImage->ValuePtr(0, y);
		float *weightsPtr = weightsOutput->ValuePtr(0, y);
		const float *end = inputPtr + width;
		while(inputPtr < end)
		{
			
			// Assign each integer to one bool in the mask
			// Convert false to 0xFFFFFFFF and true to 0
			__m128 conditionMask = _mm_castsi128_ps(
				_mm_cmpeq_epi32(_mm_set_epi32(rowPtr[3] || !isfinite(inputPtr[3]), rowPtr[2] || !isfinite(inputPtr[2]),
																			rowPtr[1] || !isfinite(inputPtr[1]), rowPtr[0] || !isfinite(inputPtr[0])),
												zero4i));
			
			_mm_store_ps(weightsPtr, _mm_or_ps(
				_mm_and_ps(conditionMask, one4),
				_mm_andnot_ps(conditionMask, zero4)
			));
			_mm_store_ps(outputPtr, _mm_or_ps(
				_mm_and_ps(conditionMask, _mm_load_ps(inputPtr)),
				_mm_andnot_ps(conditionMask, zero4)
			));
			
			rowPtr += 4;
			outputPtr += 4;
			inputPtr += 4;
			weightsPtr += 4;
		}
	}
}
开发者ID:saiyanprince,项目名称:pyimager,代码行数:39,代码来源:highpassfilter.cpp

示例14: WriteSubtractFrequencies

void Compress::WriteSubtractFrequencies(std::ofstream &stream, Image2DCPtr image, Mask2DCPtr mask)
{
	const num_t
		max = ThresholdTools::MaxValue(image, mask),
		min = ThresholdTools::MinValue(image, mask);
	const num_t normalizeFactor = (num_t) ((2<<22) + ((2<<22)-1)) / (max - min);
	//const num_t normalizeFactor = 256.0;
	const uint32_t
		width = image->Width(),
		height = image->Height();
	const char mode = 1;

	stream.write(reinterpret_cast<const char*>(&max), sizeof(max));
	stream.write(reinterpret_cast<const char*>(&min), sizeof(min));
	stream.write(reinterpret_cast<const char*>(&width), sizeof(width));
	stream.write(reinterpret_cast<const char*>(&height), sizeof(height));
	stream.write(&mode, sizeof(mode));

	std::vector<int32_t> basis(width);
	for(size_t x=0;x<width;++x)
	{
		SampleRowPtr row = SampleRow::CreateFromColumn(image, x);
		basis[x] = (int32_t) round(row->Median() * normalizeFactor);
	}
	stream.write(reinterpret_cast<char*>(&basis[0]), sizeof(basis));

	for(unsigned y=0;y<height;++y)
	{
		for(unsigned x=0;x<width;++x)
		{
			if(!mask->Value(x, y))
			{
				int32_t value = (int32_t) (round(image->Value(x, y) * normalizeFactor) - basis[x]);
				stream.write(reinterpret_cast<char*>(&value)+1, 3);
			}
		}
	}
}
开发者ID:pkgw,项目名称:aoflagger,代码行数:38,代码来源:compress.cpp

示例15: onPlotVertically

void ImagePlaneWindow::onPlotVertically()
{
	if(_heatMapPlot.HasImage())
	{
		Plot plot("Image-vertical-axis.pdf");
		plot.SetXAxisText("Declination index");
		plot.SetYAxisText("Amplitude");
		//plot.SetLogScale(false, true);
		plot.StartLine();
		Image2DCPtr image = _heatMapPlot.Image();
		for(size_t y=0;y<image->Height();++y)
		{
			num_t sum = 0.0;
			for(size_t x=0;x<image->Width();++x)
			{
				sum += image->Value(x, y);
			}
			plot.PushDataPoint(y, sum);
		}
		plot.Close();
		plot.Show();
	}
}
开发者ID:kernsuite-debian,项目名称:aoflagger,代码行数:23,代码来源:imageplanewindow.cpp


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