X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FShapeRecognition%2FShapeRec_FeatureDetector.cxx;h=4d3adaa3b0034b3c2997c5a4bb9cb116216c8664;hb=58803ba33ee53a5944d565373782e5f0868c5461;hp=b61f4bc905df5426ecab7c578b9b7840a99ca210;hpb=1d52aa34228fdf7444aee7ff75a8a1b250b2ab13;p=modules%2Fgeom.git diff --git a/src/ShapeRecognition/ShapeRec_FeatureDetector.cxx b/src/ShapeRecognition/ShapeRec_FeatureDetector.cxx index b61f4bc90..4d3adaa3b 100644 --- a/src/ShapeRecognition/ShapeRec_FeatureDetector.cxx +++ b/src/ShapeRecognition/ShapeRec_FeatureDetector.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -6,7 +6,7 @@ // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -59,7 +59,8 @@ void ShapeRec_FeatureDetector::SetPath( const std::string& thePath ) { IplImage* src = cvLoadImage(imagePath.c_str(),CV_LOAD_IMAGE_COLOR); imgHeight = src->height; - imgWidth = src->width; + imgWidth = src->width; + cvReleaseImage(&src); } } @@ -227,7 +228,6 @@ bool ShapeRec_FeatureDetector::ComputeContours( bool useROI, ShapeRec_Parameters cvReleaseImage(&sample_h_plane); cvReleaseImage(&sample_s_plane); cvReleaseImage(&input_image); - cvReleaseImage(&input_image); cvReleaseImage(&input_hsv); cvReleaseImage(&input_hplane); cvReleaseImage(&input_splane); @@ -294,6 +294,9 @@ std::string ShapeRec_FeatureDetector::CroppImage() cvSaveImage ("/tmp/cropped_image.bmp", cropped_image); + cvReleaseImage(&src); + cvReleaseImage(&cropped_image); + return "/tmp/cropped_image.bmp"; }