Use numpy.asarray instead of numpy.array for better performance in normalization matrix construction
https://github.com/nico/cvbook/blob/613f9059354147955334767148a559d6da8d0155/sfm.py#L48
In the code below:
T2 = numpy.array([ [S2, 0, -S2 * mean_2[0]], [0, S2, -S2 * mean_2[1]], [0, 0, 1] ])
it is recommended to replace numpy.array() with numpy.asarray() to avoid unnecessary copying. numpy.array() always creates a new array even when the input elements are already NumPy-compatible scalars or arrays, which can introduce minor overhead. In contrast, numpy.asarray() performs the same operation but skips the copy when possible, resulting in a more efficient execution path without changing the functionality.
Suggested change:
T2 = numpy.asarray([ [S2, 0, -S2 * mean_2[0]], [0, S2, -S2 * mean_2[1]], [0, 0, 1] ])