tensorflowkerasdeep-learninggoogle-colaboratoryuncertainty

how to add random values (random number to specific spot ) to x-ray image with tensorflow


I want to predict disease and I want to try to make the image have some noise or disruption in specific spot or randomly spot is there any method or solution for it?? is there any way to add noise (random value) to image with tensorflow

I read the image and convert it to array and make a copy of it and then add to it some number is that right?? and i have noticed that when convert it the array became values of zeros and ones even it in rgb form. i expect the some value in the array or the value in the image change to another values so when imshow (the image) notice some noise (different from guassian noise) so when the input to the model become different from the original image


Solution

  • for i in range(width//2):
    for j in range(height//2):
      y = random.randint(20,200)
      x = random.randint(20,200)
      n = random.randint(10,100)
      im_p.putpixel((x,y),(n,n,n))