maeriil / Aoriil

Image translator designed for manga but can be extended to any websites in general.
MIT License
0 stars 0 forks source link

Change the Masking method for inpainting #16

Open maeriil opened 1 year ago

maeriil commented 1 year ago

We want to change the way we mask the original text from the image in order to remove it from the image. Our current approach is as follows:

  1. Crop the image section which contains the merged text section
  2. Grab its dimensions and generate an array of size height - border_size * 2 and width - border_size * 2 with each cell containing 255 value, (white colour)
  3. Add a border around the array of size border_size with each cell containing 0 value, (black colour)
  4. Inpaint the cropped section using the mask with cv2.inpaint() with inpaint radius of 7 and INPAINT_NS.
  5. Replace the cropped section in the original image with this new inpainted section

There are few issues with this method.