From b91313a84efe1879186d128ab2825883c10f91a0 Mon Sep 17 00:00:00 2001 From: Vadim Pisarevsky Date: Thu, 26 Mar 2015 16:26:41 +0300 Subject: [PATCH] initialize the output flow in EMD (thanks to Daniel DeMenthon for the bug report) --- modules/imgproc/src/emd.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/imgproc/src/emd.cpp b/modules/imgproc/src/emd.cpp index 69006f3c4..22468da6d 100644 --- a/modules/imgproc/src/emd.cpp +++ b/modules/imgproc/src/emd.cpp @@ -1152,6 +1152,7 @@ float cv::EMD( InputArray _signature1, InputArray _signature2, { _flow.create(signature1.rows, signature2.rows, CV_32F); flow = _flow.getMat(); + flow = Scalar::all(0); _cflow = flow; }