当前位置:网站首页>Realization of beauty system with MATLAB
Realization of beauty system with MATLAB
2022-06-29 00:13:00 【Matlab scientific research studio】
1 brief introduction
With the rise of various beauty cameras in the market , People are also pursuing more perfect beauty photos . This paper presents a static image beauty method . Firstly, facial feature points are determined by face recognition , Then the image smoothing technology is introduced , The double-sided filter is used to filter the image noise and realize the whitening and brightening function ; Image fusion technology can be used , Wavelet transform image fusion algorithm is used to stack image pixels to realize decoration , A series of special effects such as filter . All algorithm results can be obtained by MATLAB Realization .
2 Part of the code
function f = qudou( g,n )
% g = imread('E:\ digital image processing \work\meiyan\1.jpg');
% n For the number of operations , The default is 1,g For the original
g2 = g;
if( nargin == 1 )
n = 1;
end
% Get the size of the original image
[ M,N,~ ] = size( g );
while( n ~=0 )
n = n - 1;
% Interactively select the processing area
mask = roipoly( g2 );
figure,imshow(mask);
x1 = immultiply( mask,g2( :,:,1 ) );
x2 = immultiply( mask,g2( :,:,2 ) );
x3 = immultiply( mask,g2( :,:,3 ) );
x = cat( 3,x1,x2,x3 );
% figure,imshow(x);
% Pre allocated memory ,f1,f2,f3 Store the operation results of three channels
f1 = zeros( M,N );
f2 = zeros( M,N );
f3 = zeros( M,N );
% Jump out of the double loop setting flag
flag = 0;
% Find the first pixel value that is not 0 The point of , Get the pixel value of this point , As pixels filled after sampling
for i = 1:M
for j = 1:N
if( x1( i,j ) ~= 0 )
r = x( i,j,: );
flag = 1;
break
end
if( flag == 1 )
break
end
end
end
% Random generation of fill images
y = zeros(3,3,3);
y( :,:,1 ) = randi([r(1)-5,r(1)+5],[3,3]);
y( :,:,2 ) = randi([r(2)-5,r(2)+5],[3,3]);
y( :,:,3 ) = randi([r(3)-5,r(3)+5],[3 3]);
% Type conversion
y = double(y);
% Process the three channels separately , Replace the original pixels with the sampled pixels
for i = 2:3:M-1
for j = 2:3:N-1
f1( i-1:i+1,j-1:j+1 ) = mask( i-1:i+1,j-1:j+1 ).* y( :,:,1 );
f2( i-1:i+1,j-1:j+1 ) = mask( i-1:i+1,j-1:j+1 ).* y( :,:,2 );
f3( i-1:i+1,j-1:j+1 ) = mask( i-1:i+1,j-1:j+1 ).* y( :,:,3 );
end
end
% Connect the three channels together
f = cat( 3,f1,f2,f3 );
% Type conversion
f = uint8( f );
% Get the processed image
a = g2 - x;
f = f + a;
g2 = f;
end
% Image filtering processing
f = double(f);
b = double( imguidedfilter( uint8( f ) ) ) - f + 128 ;
t = imfilter( b, fspecial( 'gaussian',[5 5]) );
f = ( f*50 + ( f+2*t-256 )*50 )/100;
f = uint8(f);
% % Display images
% subplot( 1,2,1 ),imshow( g ),title(' Original picture ');
% subplot( 1,2,2 ),imshow( f ),title(' Fill the processed image ');
% end
3 Simulation results

4 reference
[1] Li Yin , Li Xiaohong , Jin Jian . be based on MATLAB Development and implementation of image processing system [C]// No 21 Computer technology and application (CACIS) Academic Conference . 2010.
About bloggers : Good at intelligent optimization algorithms 、 Neural networks predict 、 signal processing 、 Cellular automata 、 The image processing 、 Path planning 、 UAV and other fields Matlab Simulation , relevant matlab Code problems can be exchanged by private letter .
边栏推荐
猜你喜欢

Implementation of dynamic timer for quartz
![[software analysis] iterative explanation of software analysis, design and modeling](/img/37/1163fec464aed365d1ea04e63a0c90.png)
[software analysis] iterative explanation of software analysis, design and modeling

Typescript -- Section 5: classes
![SQL note 2 [MySQL]](/img/a4/f711173ce731d95860746e309b7d74.jpg)
SQL note 2 [MySQL]

MySQL connection query is easy to understand

How many locks are added to an update statement? Take you to understand the underlying principles

oracle 去掉html标签
![[200 opencv routines] 101 adaptive median filter](/img/89/9e9b667dd28cb25af005b6028ef26c.jpg)
[200 opencv routines] 101 adaptive median filter

Give you a project, how will you carry out performance testing (I)

Online yaml to JSON tool
随机推荐
每日一题:数组中数字出现的次数2
Remove HTML tags from Oracle
Online yaml to JSON tool
【LeetCode】21. Merge two ordered linked lists - go language solution
Stm32f407 ------- IO pin multiplexing mapping
12. object detection mask RCNN
这玩意叫跳表?
stm32F407-------串行(串口)通信
ES6 module
Daily question 1: the number of numbers in the array 2
stm32F407-------LCD
EditText listening focus
Windows平台下安装MySQL(附:Navicat Premium 12 “使用” 教程)
What will be done after digital IC Verification?
With notes: re understanding else if
6.28 learning content
好用免费的PPT模板
MapReduce case
stm32F407-------跑马灯、蜂鸣器
Typescript -- Section 1: basic types