"error is in this line"
iError = m_FPM.CreateTemplate(null, fp_image, m_RegMin1);
Then you need to look at what the method does - and in particular what parameters it is expecting, and what it will do with them.
We can't look at a method call to an unknown object (as in: we don't even know what class m_FPM is, let alone what it does) and say: "it's parameter 1, it should be 6 instead of null" - we don't know anything about the method.
Sorry, but we can't help you, based on that information!