image-processing

How do I crop an image on a white background with python?

微笑、不失礼 提交于 2021-02-07 19:57:08
问题 I am scanning old photos, so I have the image and a white background from the scanner. My aim is to take the picture, removing the white background. How can I do that ? An example picture is the following: My simple approach: import os import time from PIL import Image from collections import Counter import numpy as np def get_cropped_image(image, crop_folder, threshold): image_name = image.split("\\")[-1] im = Image.open(image) pixels = im.load() width, height = im.size rows = [] for h_index

How do I crop an image on a white background with python?

眉间皱痕 提交于 2021-02-07 19:56:54
问题 I am scanning old photos, so I have the image and a white background from the scanner. My aim is to take the picture, removing the white background. How can I do that ? An example picture is the following: My simple approach: import os import time from PIL import Image from collections import Counter import numpy as np def get_cropped_image(image, crop_folder, threshold): image_name = image.split("\\")[-1] im = Image.open(image) pixels = im.load() width, height = im.size rows = [] for h_index

Where is convert in ImageMagick?

99封情书 提交于 2021-02-07 18:20:49
问题 I just spent an infuriating day trying to make a gif out of a series of jpg files in R. I installed ImageMagick to run the following code: system("convert -delay 40 *.png example_4.gif") but I get the following error message: Warning message: running command 'convert -delay 40 *.png example_4.gif' had status 4 which looks like a path error. Now I've looked for convert in the Imagemagick download and can't see it anywhere. Does anyone know where it is? Alternately, is there another easier

Where is convert in ImageMagick?

梦想与她 提交于 2021-02-07 18:20:24
问题 I just spent an infuriating day trying to make a gif out of a series of jpg files in R. I installed ImageMagick to run the following code: system("convert -delay 40 *.png example_4.gif") but I get the following error message: Warning message: running command 'convert -delay 40 *.png example_4.gif' had status 4 which looks like a path error. Now I've looked for convert in the Imagemagick download and can't see it anywhere. Does anyone know where it is? Alternately, is there another easier

How to generate texture mapping images?

那年仲夏 提交于 2021-02-07 14:33:24
问题 I want to put/wrap images to 3D objects. To keep things simple and fast, instead of using(and learning) a 3D library I want to use mapping images. Mapping images are used in such a way: So you generate the mapping images once for each object and use the same mapping for all images you want to wrap. My question is how can I generate such mapping images (given the 3D model)? Since I don't know about the terminology my searches failed me. Sorry if I am using the wrong jargon. Below you can see a

How to generate texture mapping images?

有些话、适合烂在心里 提交于 2021-02-07 14:32:38
问题 I want to put/wrap images to 3D objects. To keep things simple and fast, instead of using(and learning) a 3D library I want to use mapping images. Mapping images are used in such a way: So you generate the mapping images once for each object and use the same mapping for all images you want to wrap. My question is how can I generate such mapping images (given the 3D model)? Since I don't know about the terminology my searches failed me. Sorry if I am using the wrong jargon. Below you can see a

Find median of list of images

不问归期 提交于 2021-02-07 13:27:28
问题 If I have a list of images represented by 3D ndarray such as [[x,y,color],...] , what operations can I use to output an image with values that are median of all values? I am using a for loop and find it too slow. 回答1: You said your images in color, formatted as a list of 3d ndarrays . Let's say there are n images: imgs = [img_1, ..., img_n] Where imgs is a list and each img_i is a an ndarray with shape (nrows, ncols, 3) . Convert the list to a 4d ndarray, then take the median over the

Find median of list of images

99封情书 提交于 2021-02-07 13:24:07
问题 If I have a list of images represented by 3D ndarray such as [[x,y,color],...] , what operations can I use to output an image with values that are median of all values? I am using a for loop and find it too slow. 回答1: You said your images in color, formatted as a list of 3d ndarrays . Let's say there are n images: imgs = [img_1, ..., img_n] Where imgs is a list and each img_i is a an ndarray with shape (nrows, ncols, 3) . Convert the list to a 4d ndarray, then take the median over the

Improve OCR accuracy from scanned documents

a 夏天 提交于 2021-02-07 10:31:23
问题 I'm scanning a lot of A3 documents using a standard Brother A3 Multifunction and then use FineReader Pro for OCR'ing the images. However, I'm getting a lot of errors in the characters recognized, and lots of non-alphanumeric strange characters. Can someone give me any tips for programmatically improving the OCR accuracy, either pre-processing on the scanned images, or post-processing on the recognized text? Edit: Find a sample pdf. It includes some sample images from which I get the poorest

Improve OCR accuracy from scanned documents

五迷三道 提交于 2021-02-07 10:30:58
问题 I'm scanning a lot of A3 documents using a standard Brother A3 Multifunction and then use FineReader Pro for OCR'ing the images. However, I'm getting a lot of errors in the characters recognized, and lots of non-alphanumeric strange characters. Can someone give me any tips for programmatically improving the OCR accuracy, either pre-processing on the scanned images, or post-processing on the recognized text? Edit: Find a sample pdf. It includes some sample images from which I get the poorest