A list,

1 fractal interpolation is according to the principle of self-similarity and fractal geometry to send generation function system ifs theory, the known data interpolation into the curve or surface with self-similar structure, each local and whole self-similar or statistical self similarity, therefore, fractal interpolation can effectively avoid the traditional interpolation method of local characteristics between adjacent interpolation point.

In most cases, image processing is to improve the visual quality of the image. Therefore, how to evaluate the image quality is a very important problem.

In the image, the gray value between some pixels and adjacent pixels has mutation, that is, there is gray discontinuity. These pixels with gray value mutation are the edge pixels of the contour or texture image describing the object in the image. In the process of image amplification, for these pixels with discontinuous gray characteristics, if the conventional interpolation algorithm is used to generate the newly added pixels, the potential will blur the contour and texture of the enlarged image and reduce the image quality.

Iterative system functions have obvious advantages in dealing with regular fractal graphs, but for natural phenomena, random fractal processing will be more vivid.

2 cases

The fractal interpolation algorithm is used to transpose the face and dog face in the given face and dog face images.



Ii. Source code

clear all
clc
function rgbPic = bw2rgb(bwPic)
 
bwPicSize = size(bwPic);
 
rgbPic = zeros(bwPicSize(1),bwPicSize(2),3);
I = imread('people.png');
I2 = imread('dog.png');
 
doge = imresize(I2,[size(I,1) size(I,2)]);
gray = rgb2gray(I);
YCbCr = rgb2ycbcr(I);
heigth = size(gray,1);
width = size(gray,2);
for i = 1:heigth
    for j = 1:width
        Y = YCbCr(i,j,1);
        Cb = YCbCr(i,j,2);
        Cr = YCbCr(i,j,3);
        if(Y < 80)
            gray(i,j) = 0;
        else
            if(skin(Y,Cb,Cr) == 1)
                gray(i,j) = 255;
            else
                gray(i,j) = 0;
            end
        end
    end
end
SE=strel('arbitrary',eye(5));  
gray = imopen(gray,SE);
gray = imclose(gray,SE);
 
a1=(255-bw2rgb(gray))/255;
next1=immultiply(I,a1);
 
a2=bw2rgb(gray)/255;
next2=immultiply(doge,a2);
 
add=imadd(next1,next2);
 [L,num] = bwlabel(gray,8);
STATS = regionprops(L,'BoundingBox');
n = 1;
result = zeros(n,4);
part = zeros(h,w);
for i = y:(y+h)
    for j = x:(x+w)
        if bImage(i,j) == 0
            part(i-y+1,j-x+1) = 255;
        else
            part(i-y+1,j-x+1) = 0;
        end
    end
end
Copy the code

3. Operation results

Third, note

Version: 2014 a