[MAINT] Add unit test for the computation of second moment matrix

This is related to the image processing module.