From 8530450bdbc42d17fa32f34e5fef0f980c71439b Mon Sep 17 00:00:00 2001 From: scuri Date: Fri, 22 Jan 2010 19:44:05 +0000 Subject: # Fixed: imProcessRemoveByArea inside/outside logic. --- html/en/history.html | 3 +++ src/process/im_analyze.cpp | 17 ++++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/html/en/history.html b/html/en/history.html index 4f100f5..c5eb4fa 100644 --- a/html/en/history.html +++ b/html/en/history.html @@ -40,6 +40,9 @@
  • Fixed: incomplete initialization of the array in imAnalyzeMeasureArea.
  • +
  • Fixed: imProcessRemoveByArea + inside/outside logic.
  • Version 3.5 (02/Oct/2009)

    diff --git a/src/process/im_analyze.cpp b/src/process/im_analyze.cpp index 551f043..5a775a0 100644 --- a/src/process/im_analyze.cpp +++ b/src/process/im_analyze.cpp @@ -2,7 +2,7 @@ * \brief Image Analysis * * See Copyright Notice in im_lib.h - * $Id: im_analyze.cpp,v 1.4 2010/01/21 18:24:23 scuri Exp $ + * $Id: im_analyze.cpp,v 1.5 2010/01/22 19:47:56 scuri Exp $ */ @@ -1203,8 +1203,19 @@ void imProcessRemoveByArea(const imImage* image, imImage* NewImage, int connect, if (end_size == 0) end_size = image->width*image->height; - int outside=0; - if (!inside) outside = 1; + int outside; + if (inside) + { + /* remove from inside */ + inside = 0; + outside = 1; + } + else + { + /* remove from outside */ + inside = 1; + outside = 0; + } int* area_data = (int*)malloc(region_count*sizeof(int)); imAnalyzeMeasureArea(region_image, area_data, region_count); -- cgit v1.2.3