Most image functions provide parameter lists with src and dst in it.
Its users may often don’t need the src image after operation,
calling the function in-place. Straight code.
But if the respective function needs to have a temp image to do its task,
it will have to allocate for each call.
- If I get it right the functions will check if src == dest
and will allocate a temporary image if needed for the task?
So in case of many calls of the function it will be better to allocate a tmp Mat
once outside, and use that as dst for every call.
-
So opencv will check if dst is allocated and fitting and use it,
otherwise create it? -
But how shall a user know which functions will need a temp image
(dilate() etc.), and which not (threshold() etc.)?