Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

normalize numpy array

 norm = np.linalg.norm(an_array_to_normalize)

    normal_array = an_array_to_normalize/norm

or for pixels to be obtained in my case. This can be used to map values to another scale from the current scale of values.

    scaled_array = (array/np.float(np.max(array)) )*255.
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #normalize #numpy #array
ADD COMMENT
Topic
Name
4+8 =