First time here? Check out the FAQ!
let me end this question ,because the location of "template.pgm" is wrong. you should put it on project root Directory