Day 96 – Facing Image Region Missing On Your Photo? Let’s Check The Image On Missing Pixel Filler

We have old or new photos with missing image regions on the corner, and then we would go to the Photoshop tool to fix it.

It is a tedious job and costs you some dollars to fix the photos which you love.

Today, Artificial Intelligence can fix your image wherever image missing the region for you.

We will check Missing Pixel Filler how it works and fix missing image regions.

What is Missing Pixel Filler?

Missing Pixel Filler is a python package that, given images that may contain missing data regions (like satellite imagery with swath gaps), returns these images with the regions filled. These regions of missing data are filled using a dynamic method that incorporates randomly chosen, non-null neighboring pixels. The missing data filling algorithms can be changed according to user preferences.

Source: Missing Pixel Filler

What are functions available in Missing Pixel Filter?

Filling Method 1

  • fill_swath_with_random_rgb(img) – Selects pixel values from a random Gaussian distribution to fill missing pixel values.

Filling Method 2

  • fill_swath_with_random_pixel_from_image_new(img) – Fills swath gap with a random pixel from a non-missing portion of data.
  • get_random_pixel_from_image(x_arr, y_arr) – Selects other pixel values from non-missing portions of the image.

Filling Method 3

  • fill_swath_with_neighboring_pixel(img) – Fills “dynamic” system to fill swath, with nearest pixels having a higher probability of selection.
  • get_neighboring_pixel() – Selects pixel values from non-missing portions of the image to fill missing pixel values with probability inversely proportional to distance.

Let’s check the code in Google Colab and check the code here.

Cited:

@article{cao2020swathgaps,
title={Reducing Effects of Swath Gaps in Unsupervised Machine Learning},
author={Chen, Sarah, and Cao, Esther and Koul, Anirudh and Ganju, Siddha and Praveen, Satyarth and Kasam, Meher Anand},
journal={Committee on Space Research Machine Learning for Space Sciences Workshop},
year={2021}
}

Copy to Clipboard
Copy to Clipboard
Copy to Clipboard
Copy to Clipboard
Copy to Clipboard
Copy to Clipboard
Copy to Clipboard
Copy to Clipboard
Copy to Clipboard
aeroplane_224
Copy to Clipboard

Few things that need to note down here:

  1. Code is getting img variable missing, and I fixed the code.
  2. The image requires the same dimension on all sides. If I am uploading a different size, then I am getting an error “value error: 3. empty range for randrange() (621,224, -397)… E-g 224 x 224 size would be better, and you need to add a code to resize it.
  3. The code is considering the good region as a missing region on the image.  We can see on the 1st image the issue.

I have raised issue no 2 to the developer to fix the code on Google Colab.  I have added a code for the first and second; however, the third issue needs to check in a different image, or the developer needs to comment on it.

By |2021-07-23T19:26:13+00:00July 23rd, 2021|Artificial Intelligence|0 Comments

About the Author:

Leave A Comment