Commit 4b37859f5ecf193b42f3368bb1b3c7b53b3b3c9b
1 parent
9f489bb3
added predict
Showing
1 changed file
with
2 additions
and
3 deletions
Show diff stats
envi/envi.h
@@ -594,7 +594,6 @@ public: | @@ -594,7 +594,6 @@ public: | ||
594 | cimg_library::CImg<unsigned char> mask_image(maskname.c_str()); | 594 | cimg_library::CImg<unsigned char> mask_image(maskname.c_str()); |
595 | //save mask file into memory | 595 | //save mask file into memory |
596 | memcpy(mask, mask_image.data(), mask_image.size()); | 596 | memcpy(mask, mask_image.data(), mask_image.size()); |
597 | - //close mask file | ||
598 | mask_image.clear(); | 597 | mask_image.clear(); |
599 | return true; | 598 | return true; |
600 | } | 599 | } |
@@ -602,8 +601,8 @@ public: | @@ -602,8 +601,8 @@ public: | ||
602 | //p:start positon; N: number of pixels saved in X; | 601 | //p:start positon; N: number of pixels saved in X; |
603 | bool feature_matrix(void * X, unsigned char * mask, unsigned start, unsigned N) | 602 | bool feature_matrix(void * X, unsigned char * mask, unsigned start, unsigned N) |
604 | { | 603 | { |
605 | - //save pixels in X as floating numbers | ||
606 | - float * p = (float *)malloc(header.bands * sizeof(float)); | 604 | + //save pixels in X as floating numbers: float * p |
605 | + float * p = (float*)malloc(header.bands * sizeof(float)); //save pixel information | ||
607 | unsigned bandnum = header.samples * header.lines; //calculate pixel numbers in a band | 606 | unsigned bandnum = header.samples * header.lines; //calculate pixel numbers in a band |
608 | unsigned count = 0; //for counting use | 607 | unsigned count = 0; //for counting use |
609 | unsigned j = 0; //memory the pointer location in X | 608 | unsigned j = 0; //memory the pointer location in X |