Made --resample use a 64bit hash of the image data

in the file names to make it so there won't ever be any name conflicts
in the cropped images.
This commit is contained in:
Davis King 2016-07-31 09:11:52 -04:00
parent 7c828d0812
commit 6402a37458
1 changed files with 5 additions and 1 deletions

View File

@ -637,7 +637,11 @@ int resample_dataset(const command_line_parser& parser)
p.second = tform.get_tform()(p.second); p.second = tform.get_tform()(p.second);
dimg.boxes.push_back(box); dimg.boxes.push_back(box);
} }
dimg.filename = data.images[i].filename + "RESAMPLED"+cast_to_string(j)+".png"; // Put a 64bit hash of the image data into the name to make sure there are no
// file name conflicts.
std::ostringstream sout;
sout << hex << murmur_hash3_128bit(&chip[0][0], chip.size()*sizeof(chip[0][0])).second;
dimg.filename = data.images[i].filename + "_RESAMPLED_"+sout.str()+".png";
save_png(chip,dimg.filename); save_png(chip,dimg.filename);
resampled_data.images.push_back(dimg); resampled_data.images.push_back(dimg);