Tiling of large numer of images using database - python

I have coordinates in a numpy array of all the images which needs to be joined. I have used OpenCV to find the coordinates using normalized cross-correlation. I am having a problem in tiling those images as it is very large 300X300 images of resolution 640X480 pixels. For now, I am using pyvips to merge all this image to form a high-resolution image, but it is talking around 20GB RAM.
Is there any method to bring it down to <4GB? Is there any database to store all the images and display the tiled images?
I will do all the preprocessing steps before using a database. I just need a high-resolution tiled image using images and coordinates without utilizing much RAM. Even I can make those images in a grid which can be joined directly without coordinates. Please suggest a way to achieve this.

Related

Image to pixel array in python

Info: I have 30,000 jpg images that I need to convert into (NumPy) pixel arrays.
Problem: I have tried using Pillow to do the image conversions but it does about 2 images a second which would take hours to complete.
from PIL import Image
for img_num in range(30_000):
img = Image.open(img_dir+img_num+extension)
img_list.append(np.array(img))
Question: What is the best and fastest way to convert a large number of jpg images to pixel arrays using python.
I think what is taking the longest is the append() function.
Also, you are appending 30000 images to img_list, this means this single variable is extremely heavy in memory, do you actually need it? (if you image had 1000 pixels, you'd already be trying to allocate more than 30Mb)
In PIL and openCV the read oropen` functions directly make them jumpy arrays.

Applying identical Canny to two different images

I have two images - the images are identical but of different sizes.
Currently I complete a Canny analysis of the smaller image using track bars in an interactive environment.
I want to have this output created on the second (larger) image - when I apply the same parameters the output is different
I've tried to use cv.resize however the output is blurred significantly
Any help is appreciated
Thanks in advance
To archieve comparable results you should resize the bigger image to the size of the smaller one. Image upscaling is "creating" information which isn't contained in your image, that's why you see the blur. Using interpolation=cv2.INTER_AREA should deliver good results, if you used a camera for images acquisition.

Find Coordinates of cropped image (JPG) from it's original

I have a database of original images and for each original images there are various cropped versions.
This is an example of how the image look like:
Original
Horizontal Crop
Square Crop
This is a very simple example, but most images are like this, some might taken a smaller section of the original image than others.
I was looking at OpenCV in python but I'm very new to this kind of image processing.
The idea is to be able to save the cropping information separate from the image to save space and then generate all the cropping and different aspect ratio on the fly with a cache system instead.
The method you are looking for is called "template matching". You find examples here
https://docs.opencv.org/trunk/d4/dc6/tutorial_py_template_matching.html
For your problem, given the large images, it might be a good idea to constrain the search space by resizing both images by the same factor. So that searching a position that isn't as precise, but allows then to constrain the actual full pixel sized search to a smaller region around that point.

Images registration for low resolution highway images

I am using opencv with Python and I have a collection of images of highways. They have fixed resolution 352*288. They have been taken by mounted cameras, these cameras rotated horizontally and diagonally. I want to align this highways into piles,
I have tried feature passed images registration using SIFT, SURF and ORB. They are providing good results but when the image have rotation diagonally and when there is a small zooming the aligning will be damaged.
I have tried intensity based image registration using findTransformEcc and it is a little bit acceptable, but when I tried intensity based image registration using Matlab the results are much better.
example of images:
first image
second image

Comparing hundreds of JPEG images taken from multiple angles

I am comparing X-ray images to find a specific difference between these images. All images are in jpeg format. Sometimes there are six, or eight different camera angles from which these images are taken. From each angle there are ~ 100 images. I am trying to compare a couple of hundred images to identify a specific difference between these images.
I am using Python and I am relatively new to it. Can Sci-kit image segmentation be used for the following problems?
Compensate for the image exposure variations in all images
Compensate for image size variations in all images
I don't know Sci-kit, but I'm sure OpenCV can do the job!
https://en.wikipedia.org/wiki/OpenCV
http://docs.opencv.org/2.4/modules/stitching/doc/exposure_compensation.html
http://docs.opencv.org/2.4/modules/objdetect/doc/cascade_classification.html

Categories

Resources