makeGaussianPdfKernelString function
Implementation
String makeGaussianPdfKernelString(int radius, double sigma) {
List<double> w = [];
double total = 0.0;
for (int i = 0; i < radius; ++i) {
double x = _gaussianPdf(i * 1.0, sigma);
w.add(x);
total += x;
if (i > 0) total += x;
}
StringBuffer sb = StringBuffer("");
String sep = "";
for (int i = 0; i < radius; ++i) {
sb.write(sep);
sep = ", ";
sb.write("${w[i] / total}");
}
return "float kernel[$radius] = float[$radius](${sb.toString()});";
}