Image Registration + Banded Images - python

I am currently working on a image registration / image alignment problem. To illustrate the problem let us assume that there is a shift in the image pixels.
Currently i have tried the following methods:
Feature extraction using SURF
Apply Homography + RANSAC
Even then there is a mis-alignment with the images, due to the banding of the images. I would like to address if there is anyway we can correct the banding of the images to align in a proper manner.
Banded Image - pixel shift
Reference Image
Currently I am using OpenCV and Python to do the analysis.

Related

Text Documents Image Alignment

I am trying different image alignment approaches to align the images containing texts using Computer Vision. I have tested following image alignment approaches:
Probabilistic Houghlines Transform to align images according to the detected lines. https://medium.com/p/97b61eeffb20 is my implementation. But that didn't help me as expected.
Implemented SIFT and ORB to detect and align images according to the template image but instead of aligning all images, it distorts the image sometimes. I have used https://pyimagesearch.com/2020/08/31/image-alignment-and-registration-with-opencv/ as a reference.
Edge detection followed contour detection, corner detection and perspective transformation. But it doesn't work with images having different background types. This is the reference example https://pyimagesearch.com/2014/09/01/build-kick-ass-mobile-document-scanner-just-5-minutes/
morphology followed by contour detection and masking. Reference Crop exactly document paper from image
Trained the YOLO(You only look once) object detector to detect the documents but it detects the bounding box, my requirement is Quardilaterl with four image corners from which I can align documents using perspective transform.
Calculating the skewness and deskewing. Reference: https://github.com/sbrunner/deskew
But I couldn't align the document(identity documents such as citizenship, passport, license etc) images with different backgrounds perfectly using the above approaches.
This is a sample test image(important information are hidden due to privacy issue).
Is there are any other approaches of image alignment which can align the document images perfectly by correcting the skewness of the available text. My main focus is to extract the information form document using OCR preserving the information sequence in the document image.
Thank you!
To me, the third approach seems to be the most promising. But as you said, a cluttered background is a problem. Two ideas came to me about this:
Implementing a GUI as a fallback solution, so the user could select the contour.
Render some artificial dataset of official documents against a cluttered background and train a CNN to predict a segmentation map of the document. This map could be used then, as an initialization for the edge detection / contour detection. This answer contains two links to databases of images of official documents. Maybe these are of some use for you.

python library Image processing- find image tearing

I'm looking for a method to understand when an image has a tear in the data -
All I could think of is running vertically pixel by pixel and "understanding" major changes in data
tearing in image:
tears are always horizontal
Any suggestion will be helpful
To solve a similar issue I was having with my images, I was able to filter the images using the standard deviation of the laplacian. If your untorn images are similar to the torn images you may be able to differentiate between them and discard the images with a standard deviation above some value. Other edge detection algorithms such as Canny may work as well.
A simple implementation to import an image and calculate the standard deviation of the laplacian can be done using opencv in python.
import cv2 as cv
ddepth = cv.CV_16S # desired depth of destination image
kernel_size = 3 # Aperture size used to compute the second-derivative filters
path = r"C:\Your\filepath\here" # Directory to get files from
img = cv.imread(path, cv.IMREAD_COLOR) # Read image
std = cv.Laplacian(img, ddepth,
ksize=kernel_size).std() # Get sd of laplacian. If std is too high, maybe image tearing
I am sure there are better approaches to this problem, so hopefully you will get other answers as well.

How to extract noise distribution of an image and apply it to aonther image?

Question about synthetic images to simulate documents scanned by scanner or shot by cameras, using python.
I want to generate images with simlar distribution noise but not exactly the same background of original images. I'm confused about:
How to extract the noise distribution of an image,
and how to apply it to another image.

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

Categories

Resources