From 4b37859f5ecf193b42f3368bb1b3c7b53b3b3c9b Mon Sep 17 00:00:00 2001 From: heziqi Date: Fri, 31 Oct 2014 14:17:48 +0800 Subject: [PATCH] added predict --- envi/envi.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/envi/envi.h b/envi/envi.h index aba052e..adc4c61 100644 --- a/envi/envi.h +++ b/envi/envi.h @@ -594,7 +594,6 @@ public: cimg_library::CImg mask_image(maskname.c_str()); //save mask file into memory memcpy(mask, mask_image.data(), mask_image.size()); - //close mask file mask_image.clear(); return true; } @@ -602,8 +601,8 @@ public: //p:start positon; N: number of pixels saved in X; bool feature_matrix(void * X, unsigned char * mask, unsigned start, unsigned N) { - //save pixels in X as floating numbers - float * p = (float *)malloc(header.bands * sizeof(float)); + //save pixels in X as floating numbers: float * p + float * p = (float*)malloc(header.bands * sizeof(float)); //save pixel information unsigned bandnum = header.samples * header.lines; //calculate pixel numbers in a band unsigned count = 0; //for counting use unsigned j = 0; //memory the pointer location in X -- libgit2 0.21.4