头文件包含了了,环境配置步骤也重新看了一遍。
vector<int> compression_params;
compression_params.push_back(CV_IMWRITE_PNG_COMPRESSION);
compression_params.push_back(9);//从0-9较高的值意味着更小的尺寸和更长的压缩时间而默认值是3.
string fitness_str = to_string(pop[max_scallop.first].fit_value), generation_str = to_string(generation);
string str = "C:\\Visual Studio 2017 Projects\\GA\\GA\\第" + generation_str + "代最优扇贝" + fitness_str + ".png";
imwrite(str, dst_image, compression_params);