Keypoints morphing - morphing

Is there a library/software which can accept a number of keypoints and matches of them between images and produce a morph? Or any ideas/algorithms on how to do it?

Xmorph and GTK morph can do that -- although the key points must be parts of equivalent rectangle grids. The underlying algorithm can be accessed through a C API.

An older piece of software by Gryphon Software could do image morphing. I saw an article about it from 1994. I couldn't find a company site, so they may be abandon ware now.
Her is a quote from a Wikipedia article about a film editing technique called Dissolve.
In non-linear video editing, a dissolve is done in software, by interpolating gradually between the RGB values of each pixel of the image.
Hope that helps.

Related

Extract numbers from Image

I have an image for mobile phone credit recharge card and I want to extract the recharge number only (the gray area) as a sequence of number that can be used to recharge the phone directly
This is a sample photo only and cannot be considered as standard, thus the rectangle area may differ in position , in the background and the card also may differ in size .The scratch area may not be fully scratched , the camera's depth and position may differ too . I read a lots and lots of papers on the internet but i can't find any thing that could be interesting and most of papers discuss detection of handwritten numbers .
Any links or algorithms names could be very useful .
You can search the papers on vehicle plate number detection with machine learning methods. Basically you need to extract the number first, you may use sobel filter to extract the vertical edges , then threshold (binary image) and morphologic operations (remove blank spaces between each vertical edge line, and connect all regions that have a high number of edges). Finally retrieve the contour and fill in the connected components with mask.
After you extract the numbers , you can use machine learning method such as neural network and svm to recognize them.
Hope it helps.
Extract the GRAY part from image and then Use Tesseract(OCR) to extract the text written on the gray image.
I think you may not find the algorithm to read from the image on the internet. Nobody will disclose that. I think, if you are a hardcore programmer you can crack that using your own code. I tried from the screenshots where the fonts were clearer and the algorithm was simple. For this, the algorithm should be complex since you are reading from photo source instead of a screenshot.
Follow the following steps:
Load the image.
Select the digits ( By contour finding and applying constraints on area and height of letters to avoid false detections). This will split the image and thus modularise the OCR operation you want to perform.
A simple K - nearest neighbour algorithm for performing the identification and classification.
If the end goal was just to make a bot, you could probably pull the text directly from the app rather than worrying about OCR, but if you want to learn more about machine learning and you haven't done them already the MNIST and CIFAR-10 datasets are fantastic places to start.
If you preprocessed your image so that yellow pixels are black and all others are white you would have a much cleaner source to work with.
If you want to push forward with Tesseract for this and the preprocessing isn't enough then you will probably have to retrain it for this font. You will need to prepare a corpus, process it similarly to how you expect your source data to look, and then use something like qt-box-editor to correct the data. This guide should be able to walk you through the basic steps of retraining.

Algorithm for capturing machine readable zones

What method is suitable to capture (detect) MRZ from a photo of a document? I'm thinking about cascade classifier (e.g. Viola-Jones), but it seems a bit weird to use it for this problem.
If you know that you will look for text in a passport, why not try to find passport model points on it first. Match template of a passport to it by using ASM/AAM (Active shape model, Active Appearance Model) techniques. Once you have passport position information you can cut out the regions that you are interested in. This will take some time to implement though.
Consider this approach as a great starting point:
Black top-hat followed by a horisontal derivative highlights long rows of characters.
Morphological closing operation(s) merge the nearby characters and character rows together into a single large blob.
Optional erosion operation(s) remove the small blobs.
Otsu thresholding followed by contour detection and filtering away the contours which are apparently too small, too round, or located in the wrong place will get you a small number of possible locations for the MRZ
Finally, compute bounding boxes for the locations you found and see whether you can OCR them successfully.
It may not be the most efficient way to solve the problem, but it is surprisingly robust.
A better approach would be the use of projection profile methods. A projection profile method is based on the following idea:
Create an array A with an entry for every row in your b/w input document. Now set A[i] to the number of black pixels in the i-th row of your original image.
(You can also create a vertical projection profile by considering columns in the original image instead of rows.)
Now the array A is the projected row/column histogram of your document and the problem of detecting MRZs can be approached by examining the valleys in the A histogram.
This problem, however, is not completely solved, so there are many variations and improvements. Here's some additional documentation:
Projection profiles in Google Scholar: http://scholar.google.com/scholar?q=projection+profile+method
Tesseract-ocr, a great open source OCR library: https://code.google.com/p/tesseract-ocr/
Viola & Jones' Haar-like features generate many (many (many)) features to try to describe an object and are a bit more robust to scale and the like. Their approach was a unique approach to a difficult problem.
Here, however, you have plenty of constraint on the problem and anything like that seems a bit overkill. Rather than 'optimizing early', I'd say evaluate the standard OCR tools off the shelf and see where they get you. I believe you'll be pleasantly surprised.
PS:
You'll want to preprocess the image to isolate the characters on a white background. This can be done quite easily and will help the OCR algorithms significantly.
You might want to consider using stroke width transform.
You can follow these tips to implement it.

Recommended pattern recognition technique for chess board

I'm trying to do an application which, among other things, is able to recognize chess positions on a computer screen from screenshots. I have very limited experience with image processing techniques and don't wish to invest a great amount of time in studying this, as this is just a pet project of mine.
Can anyone recommend me one or more image processing techniques that would yield me a good result?
The conditions are:
The image is always crispy clean, no noise, poor light conditions etc (since it's a screenshot)
I'm expecting a very low impact on computer performance while doing 1 image / second
I've thought of two modes to start the process:
Feed the piece shapes to the program (so that it knows what a queen, king etc. looks like)
just feed the program an initial image which contains the startup position, from which the program can (after it recognizes the position of the board) pick each chess piece
The process should be relatively easy to understand, as I don't have a very good grasp of image processing techniques (yet)
I'm not interested in using any specific technology, so technology-agnostic documentation would be ideal (C/C++, C#, Java examples would also be fine).
Thanks for taking the time to read this, and I hope to get some good answers.
It' an interesting problem, but you need to specify a lot more than in your original question in order to find an acceptable answer.
On the input images: "screenshots" is quote vague a category. Can you assume that the chessboard will always be entirely in view? Will you have multiple views of the same board? Can you assume that no pieces will be partially or completely occluded in all views?
On the imaged objects and the capture system: will the same chessboard and pieces be used, under very similar illumination? Will the same lens/camera/digitization pipeline be used?
Salut Andrei,
I have done a coin counting algorithm from a picture so the process should be helpful.
The algorithm is called Generalized Hough transform
Make the picture black and white, it is easier that way
Take the image from 1 piece and "slide it over the screenshot"
For each cell you calculate the nr of common pixel in the 2 images
Where you have the largest number there you have the piece
Hope this helps.
Yeah go with Salut Andrei,
Convert the picture into greyscale
Slice into 64 squares and store in array
Using Mat lab can identify the pieces easily
Color can be obtained from Calculating the percentage of No. dot pixels(black pixels)
threshold=no.black pixels /no. of black pixels + no. of white pixels,
If ur value is above threshold then WHITE else BLACK
I'm working on a similar project in c# finding which piece is which isn't the hard part for me. First step is to find a rectangle that shows just the board and cuts everything else out. I first hard-coded it to search for the colors of the squares but would like to make it more robust and reliable regardless of the color scheme. Trying to make it find squares of pixels that match within a certain threshold and extrapolate the board location from that.

Image processing [duplicate]

I need to count out boxes in a warehouse by using edge detection techniques; images will be taken from a 3D model of a warehouse and the propose system will be used 3 images in 3 different angles to cover the whole area of a warehouse.
As I have no experience in image processing before I'm a bit confused about which algorithm to use.
For a quick start I would suggest looking at those two:
Sobel operator
Canny operator
These are the most widely used edge detection filters with pretty good results.
If you are starting to learn computer vision, you should also learn about typical operations in image processing and convolution.
The OpenCV library is a great library which implements many algorithms of computer vision, including the two operators mentioned above.
Check out AForge. It has full C# implementation of some edge detection algorithms.
Take a look at Image Processing Library for C++ question. You can find several useful links there. The suggested libraries not only have algorithm description but also their implementations.
OpenCV has a very nice algorithm which detects closed contours in an image and returns them as lists of points. You can then throw away all contours which don't have 4 points, and then check some constraints of the remaining ones (aspect ratio of the rectangles, etc...) to find your remaining box sides. This should at least solve the image processing part of your problem, though turning this list of contours into a count of boxes in your warehouse is going to be tough.
Check here for the OpenCV function:
http://opencv.willowgarage.com/documentation/structural_analysis_and_shape_descriptors.html#findcontours
http://opencv.willowgarage.com/documentation/drawing_functions.html#drawcontours
'Sujoy Filter' is better than Sobel Filter for Edge-detection. Here's the Julia implementation (with paper link): Sujoy Filter

Image edge detection

I need to count out boxes in a warehouse by using edge detection techniques; images will be taken from a 3D model of a warehouse and the propose system will be used 3 images in 3 different angles to cover the whole area of a warehouse.
As I have no experience in image processing before I'm a bit confused about which algorithm to use.
For a quick start I would suggest looking at those two:
Sobel operator
Canny operator
These are the most widely used edge detection filters with pretty good results.
If you are starting to learn computer vision, you should also learn about typical operations in image processing and convolution.
The OpenCV library is a great library which implements many algorithms of computer vision, including the two operators mentioned above.
Check out AForge. It has full C# implementation of some edge detection algorithms.
Take a look at Image Processing Library for C++ question. You can find several useful links there. The suggested libraries not only have algorithm description but also their implementations.
OpenCV has a very nice algorithm which detects closed contours in an image and returns them as lists of points. You can then throw away all contours which don't have 4 points, and then check some constraints of the remaining ones (aspect ratio of the rectangles, etc...) to find your remaining box sides. This should at least solve the image processing part of your problem, though turning this list of contours into a count of boxes in your warehouse is going to be tough.
Check here for the OpenCV function:
http://opencv.willowgarage.com/documentation/structural_analysis_and_shape_descriptors.html#findcontours
http://opencv.willowgarage.com/documentation/drawing_functions.html#drawcontours
'Sujoy Filter' is better than Sobel Filter for Edge-detection. Here's the Julia implementation (with paper link): Sujoy Filter

Resources