diff --git a/components/operators/src/depth.cpp b/components/operators/src/depth.cpp
index 2c689c2b45054e158f92adac8904814885836b60..24597a23312f53ca1bb233e7daa3cc7fd6cdedde 100644
--- a/components/operators/src/depth.cpp
+++ b/components/operators/src/depth.cpp
@@ -147,8 +147,11 @@ void DepthChannel::_createPipeline(size_t size) {
 	#ifdef HAVE_LIBSGM
 	pipe_->append<ftl::operators::FixstarsSGM>("algorithm");
 	#else
+	// TODO fix windows build
+	#ifndef _MSC_VER
 	pipe_->append<ftl::operators::StereoDisparity>("algorithm");
 	#endif
+	#endif
 	pipe_->append<ftl::operators::DisparityBilateralFilter>("bilateral_filter");
 	//pipe_->append<ftl::operators::OpticalFlowTemporalSmoothing>("optflow_filter", Channel::Disparity);
 	pipe_->append<ftl::operators::DisparityToDepth>("calculate_depth");
diff --git a/lib/libstereo/src/stereo_censussgm.cu b/lib/libstereo/src/stereo_censussgm.cu
index ec96e7d64083a321389b1c1bd9f313e24583ab79..d707e784651fed12ed215e56b9ca84107b1c64f4 100644
--- a/lib/libstereo/src/stereo_censussgm.cu
+++ b/lib/libstereo/src/stereo_censussgm.cu
@@ -53,20 +53,18 @@ struct StereoCensusSgm::Impl {
 	//DisparitySpaceImage<unsigned short> dsi;
 	CensusMatchingCost cost;
 	Array2D<unsigned short> cost_min_paths;
-	Array2D<float> confidence;
+	Array2D<unsigned short> uncertainty;
 	Array2D<float> disparity_r;
 	Array2D<uchar> l;
 	Array2D<uchar> r;
 
-	cv::Mat uncertainty;
-
 	PathAggregator<StandardSGM<CensusMatchingCost::DataType>> aggr;
 	WinnerTakesAll<DSImage16U,float> wta;
 
 	Impl(int width, int height, int min_disp, int max_disp) :
 		cost(width, height, min_disp, max_disp),
 		cost_min_paths(width, height),
-		confidence(width, height),
+		uncertainty(width, height),
 		disparity_r(width, height), l(width, height), r(width, height) {}
 
 };
@@ -111,14 +109,16 @@ void StereoCensusSgm::compute(cv::InputArray l, cv::InputArray r, cv::OutputArra
 	// Bioinformatics). https://doi.org/10.1007/978-3-319-11752-2_4
 
 	if (disparity.isGpuMat()) {
-		cv::cuda::subtract(impl_->wta.min_cost.toGpuMat(), impl_->cost_min_paths.toGpuMat(), impl_->uncertainty);
+		auto uncertainty = impl_->uncertainty.toGpuMat();
+		cv::cuda::subtract(impl_->wta.min_cost.toGpuMat(), impl_->cost_min_paths.toGpuMat(), uncertainty);
 		cv::cuda::compare(uncertainty, params.uniqueness, uncertainty, cv::CMP_GT);
 		impl_->wta.disparity.toGpuMat().setTo(0, uncertainty);
 	}
 	else {
-		cv::subtract(impl_->wta.min_cost.toMat(), impl_->cost_min_paths.toMat(), impl_->uncertainty);
+		auto uncertainty = impl_->uncertainty.toMat();
+		cv::subtract(impl_->wta.min_cost.toMat(), impl_->cost_min_paths.toMat(), uncertainty);
 		cv::compare(uncertainty, params.uniqueness, uncertainty, cv::CMP_GT);
-		impl_->wta.disparity.toMat().setTo(0, uncertainty);
+		impl_->wta.disparity.toGpuMat().setTo(0, uncertainty);
 	}
 
 	median_filter(impl_->wta.disparity, disparity);