3

Local Standardization

Unsolved
Computer Vision

Difficulty: 2 | Problem written by mesakarghm
Pixel Standardization is used to transform the distribution of pixel values to be a standard Gaussian with a mean of 0.0 and a standard deviation of 1.0.

In Local Standardization, the mean and standard deviation of the image are calculated per channel, and these values are used separately in each channel to standardize the pixel values. 

Write a function def local_standardization(image), which takes in an rgb image as input (3D numpy array) and performs local standardization on it. The shape of the output image should be exactly the same as that of the input image. 

Sample Input:
<class 'list'>
image: [[[111 12 33] [ 44 15 16]] [[ 75 98 19] [120 131 112]] [[ 13 141 15] [ 16 127 183]]]

Expected Output:
<class 'numpy.ndarray'>
[[[ 0.7229127 -1.0737823 -0.6926652 ] [-0.49303246 -1.019337 -1.0011886 ]] [[ 0.06956904 0.48698306 -0.9467433 ] [ 0.88624865 1.0858815 0.74106115]] [[-1.0556339 1.2673658 -1.019337 ] [-1.0011886 1.0132877 2.0296001 ]]]

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Praesentium reiciendis tenetur est iusto placeat, expedita distinctio dicta ipsam, voluptatum consectetur autem tempore sint eum magnam molestiae corporis ratione reiciendis, sit voluptatibus repellendus esse quam, exercitationem enim recusandae. Exercitationem delectus ab animi assumenda, deleniti odio soluta magni provident dignissimos culpa, voluptatum provident voluptate libero ex dolore dolorum amet sapiente at, error quo laudantium labore exercitationem ipsum quasi doloremque ab, asperiores laborum ut atque nulla sequi? Ipsa in voluptates explicabo repellat, hic voluptas libero eligendi magnam expedita eos accusamus non maxime, aut aliquam quas sunt quis labore possimus facere nulla provident?

Dolorem exercitationem ab ducimus veritatis laborum molestias voluptate itaque voluptatem, labore libero harum eaque amet voluptatem sequi accusantium? Fugiat quasi natus mollitia consequatur aliquid ab. Eius magni dolor doloremque excepturi veritatis necessitatibus eos molestiae autem nisi, aperiam consequuntur in cum ratione amet, eveniet corrupti adipisci, illo eum aliquam ratione voluptatem magnam id itaque neque quaerat temporibus, ea quam illum neque quisquam vero vel iusto laboriosam libero rerum?

Expedita laborum voluptates commodi quia repellat, quia earum beatae nostrum quis aliquam reprehenderit aliquid, magnam eius ex? Ratione cumque officia doloribus inventore debitis officiis minus, ea laudantium ut ipsa veniam sint neque harum?

This is a premium feature.
To access this and other such features, click on upgrade below.

Ready.

Input Test Case

Please enter only one test case at a time
numpy has been already imported as np (import numpy as np)