What are temp1,temp2 used for?

Hi,I am try to understand source code of sparsePyrLKOptical algorithm, i see code in page above, it seems temp1, temp2 is used for nothing, just a multiply operation, so I wonder what are they used for? or just debug code ,forgetting deleted.
by the way, Is there any material helping me to get this algorithm more clearly?, thank you.

looks like it to me as well.

The algorithm and its original paper:

but, when i comment the 3 lines(line 166, 167,168) out, the output result seems to be wrong…

ah okay, then

GpuMat temp2 = nextPts.reshape(1);

must cause the result to go into nextPts. the reshape is probably a view, not a copy.

yes, reshape returns another header for same data I’ll check it.