Skip to content

Commit

Permalink
minor refactor
Browse files Browse the repository at this point in the history
Former-commit-id: daf5ed4
  • Loading branch information
stefie10 committed Jul 12, 2016
1 parent 9154f80 commit 9050805
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/ein_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,15 @@ void writeMatToYaml(Mat m, FileStorage & fs) {


void writeBinaryToYaml(unsigned char * data, int length, FileStorage & fsvO) {
int max_string_length = 4095;


string compressed_data = compress_string(data, length);
string encoded_data = base64_encode((unsigned char *) compressed_data.data(), compressed_data.size());



vector<string> strings;
int current_idx = 0;
int string_length = encoded_data.size();
int max_string_length = 4095;
fsvO << "[:";
while (current_idx < string_length) {
int end_idx = min(current_idx + max_string_length, string_length);
Expand Down

0 comments on commit 9050805

Please sign in to comment.