Posts from the “Image Processing” Category

Correlate Material Point Method and Image Morphing

The algorithms of Material Point Method and Image Morphing seem similar. Both of them compute a group of parameters/coefficients based on the initialized particles/landmarks, then, update every element in the output through the parameters/coefficients:

Material Point Method

1. Initialize the parameters of material points / particles: position. velocity, mass, volume, and stress. There could be other combinations of parameters, it depends on the material being simulated.

2. Compute the parameters of each grid for the simulation of the material, such as deformation, fluid animation, by projecting data from the material points to the grid.

3. In each time phase, the parameters of material points (or the grids)  are updated based on those of the grids.

Image Morphing

1. Initialize landmarks on the input images.

2. Compute the coefficients of the transformation based on the landmarks’ positions.

3. In each time phase, the corresponding positions in the input images are compute based on the coefficients of the transformation.

Algorithm: build mosaic from phase correlation

1. Read in a series of images into a list: I_list1.

2. Fit the sizes of the images to the maximum width and height.

3. Create two lists: I_list2 and I_list3. I_list2 holds the images removed from I_list1 whose coordinates in the canvas have been computed. I_list3 takes the images removed from I_list2, which have calculated the phase correlations with all the images in I_list1.

4. Initialize: remove the first image in I_list1 to I_list2. (The first image is the default target, locates at (0,0) of the canvas)

5. While I_list1 is not empty:

5.1. Take the first image in I_list2 as the target image J1 of this loop.

5.2. For each image J2 in I_list1.

5.2.1. Do phase correlation between J1 and J2.

5.2.2. If correlated: (1) compute J2’s coordinates in canvas based on J1’s coordinate and the position of the peak. (2) Remove J2 from I_list1 to I_list2.

5.2.3 If not correlated: continue.

5.3. Remove J1 from I_list2 to I_list3.

6. Remove the left images in I_list2 to I_list3.

7. Update the computed coordinates into positive. (As we set the target image’s coordinates as (0, 0), other images’ coordinate could be negative)

8. Add all images in I_list3 to the canvas, depending on their coordinates (calculated in the same order as stored in I_list3).