Lucrare 1

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 16

IMAGE ANALYSIS BY OPTICAL INTERFEROMETRY WITH WHITE

LIGHT FOR EHD CONTACT POINT. LOAD DIFFERENT AND


CONTINUOUSLY VARIABLE SPEED.

Ioan Ungureanu
Department of Mechanical Engineering, ”Stefan cel Mare” University of Suceava, 13, University Street, 720229, Romania
Corresponding Author / E-mail: ionut@fim.usv.ro,

KEYWORDS : Film thickness, lubrication EHD, interferometry, color space, RGB, HSV, XYZ.

Film thickness measurements of lubricated contacts are important to evaluate


the quality of lubrication. Especially in concentrated contacts under high pressures in
the range of GPa, the interaction between the lubricant and the contacting bodies
causes elastic deformations of the contact area. Due to reasons of mass flow
continuity, the film thickness reduces in the outlet zone. In practice, the contact
occurs over a very small area, leading to a significantly high contact pressure even at
relatively low loads. The paper deals with image processing experimentally obtained
for EHD contact lubricated by using images obtained by optical interferometry with
white light. Using the Matlab software can obtain a series of image processing in
various color spaces. For these experiments we used a video camera 720 x 720
pixels. By processing the images obtained are obtained fringes appeared, color
space, the amplitude and phase of their processing algorithm.

1. Introduction of lubricating oil, temperature, etc. For


investigations on the EHD film
Measuring the thickness of the thickness in phase, using a contact
lubricant film in the gap between two between the glass disc coated with a
surfaces with different surface semitransparent layer of chromium and
topography plays an important role in a steel ball, separated by a lubricant
many applications in engineering film in the direction of flow in the
practice and research fields. Several contact area. The light beam passes
optical methods have been used for through glass disk will be partially
film thickness measurement systems reflected at the interface between the
of various lubrication conditions or glass disk and the layer of chromium
hydrodynamic and elastohydrodynamic and another portion that would pierce
them. Most difficult would seem to be the lubricant layer is reflected by the
those of the elastohydrodynamic, but if surface of the ball. Thus, using a
a non-stationary conditions lubrication pattern Otherwise based on the
of the contact between the two phenomenon of interference fringe can
surfaces. The surfaces do not have a be obtained mono-color image, when
direct contact with each other, and monochromatic and multi-color fringes,
between them is interposed a layer of when using white light (interferometer).
lubricant with different thicknesses, The basic principle for the formation of
depending on the rolling speed, the rings (fringes) of interference in
load applied to the contact, the monochromatic interferometry is
geometry of the surface, the properties shown in Figure 1.
a certain film thickness and the
resolution is better than that resulting
monochromatic interferometry method.
Given the correlation between film
thickness and the color spectrum,
which is known to be nonlinear and
influenced by speed and variable load
is mandatory phase calibration
measurement. The biggest
disadvantage of using white light
Fig.1. Principle of monochromatic interferometry is the limit of the
interferometry measuring range. Film thicknesses
less than 0.1 micrometres tend to
The film thickness can be appear as shades of gray
measured, when using white light (theoretically, black = zero). The
interferometry, knowing the wavelength thickness of approximately 1
of white light and the index of refraction micrometres fringes are not visible due
of the layers in contact. However, the to consistency with natural light.
resolution is in this case limited, Although measuring range is quite
because usually the thickness of the narrow, this method is still commonly
film, in the case of monochrome, may used.
be calculated only for a size that can A schematic diagram of the stand
be interpolated. The difference designed and executed in the
between the wavelength and the "University of Suceava, Romania" is
refractive index of the lubricant is of the shown in Figure 2. Mechanical is
order of 90 nm. When using white light composed mainly of:
interferometry, each corresponding to

Fig. 2. Components parts: 1. Support stand; 2. The motor drive (DC); 3. Semireflectiv
glass disc; 4. Steel ball; 5. Three bearings support; 6. Rod support; 7. Load plate; 8.
Core; 9. Coil; 10. The permanent magnet; 11. The coil support.

The device was used to obtain images of flat plate loading. For this reason we
filmed for calculation of lubricant film used a single column for the whole
thickness, the ball of steel and glass device that is mounted practically all
disc is shown in Figure 2. The support parts of supporting components. Above
device is placed on a flat surface so the bobbin holder is mounted stand,
that the surface can ensure parallelism fixed to the column by means of a bolt
which ensures the distance between For correct fitting of the motor
the support and the coil. Engine bracket balanced by means of two
mounting bracket support disc is a rods, which ensures the parallelism of
parallelepiped shaped part. It has a the support stand and the motor. The
slot which may allow for movement of motor shaft is assembled by relieving a
the piece-supporting rod vertically. sleeve provided with a shoulder. On
Locking the workpiece on the rod this disc shoulder mounted glass disc
ensures proper position in the vertical fixed via a thumbscrew, the bushing.
direction of the engine. Glass disc rests on a ball bearing
supported in a certain position three
thrust bearings, as shown in Figure 3.
To illustrate more clearly how
the film thickness is obtained from an
image taken from a camera (CCD
camera), the results most important to
come into contact and intermediate will
be described later with an example. To
this end, we chose an image obtained
on the stand by the University "Ștefan
Cel Mare" with your CCD camera. This
can be easily obtained by making the
films obtained sequences (frames),
ball disc shown in Figure 4. The image was also
bearing
used commonly for testing during start-
up program processing. The picture
shows a contact EHL between a steel
ball with a diameter of about 12,4 mm,
in steady-state conditions, at a disc
rotational speed of the drive between
shaft
support 33,33 and 100,00 rpm and a variable
load 5,54 to la 18,83 N. Image has a
resolution of 386 × 420 pixels and a
Fig. 3. The ball bearing support pixel corresponds to a length of 9,26
microns.
(a), n = 33,33 rpm (b) n = 66,66 rpm (c) n = 100,00 rpm

Fig. 4. Interferograms selected for a loading of 12,56 N variable speed obtained


using a sinusoidal signal of 33.33 to 100 rpm, at a frequency of 0.5 Hz (Period = 2 s),
for a contact EHD.

În prezenta lucrare se vor arata studiile efectuate în Matlab 2012a …!!!!!!!


…………………..
În figurile 5,6,7 sunt prezentate interferogramele pentru culoarea roșie pentru cele
trei imagini de mai sus.

(a) (b) (c)

Fig. 5. Interferogramele de culoare roșie

(a) (b) (c)

Fig. 6. Interferogramele de culoare verde


(a) (b) (c)

Fig. 7. Interferogramele de culoare albastru

(a) (b) (c)

Fig. 8. Canalul Hue

(a) (b) (c)

YCbCr

(a)(n =33,33 rpm) (b) (n =33,33 rpm) (c) (n =33,33 rpm)


CMY

(a) (n =33,33 rpm) (b) (n =33,33 rpm) (c) (n =33,33 rpm)

Wrapped and Unwrapped


(c) (n =33,33 rpm)

(b) (n =33,33 rpm)

Wrapped si Unwrapped

Semnal sinusoidal n = 33,33 – 100,00 rpm ( perioada 0,5 s dy 5)

(a), n = 41,66 rpm (b) n = 49,99 rpm (c) n = 66,66 rpm

Fig. 4. Interferograms selected for a loading of 12,56 N variable speed obtained


using a sinusoidal signal of 33.33 to 100 rpm, at a frequency of 2 Hz (Period = 0,5 s),
for a contact EHD.
(a) (b) (c)

Fig. 5. Interferogramele de culoare roșie

(a) (b) (c)

Fig. 5. Channel Hue

Semnal sinusoidal n = 33,33 – 100,00 rpm ( perioada 0,5 s)

(a), n = 41,66 rpm (b) n = 66,66 rpm (c) n = 74,99 rpm

Fig. 4. Interferograms selected for a loading of 18,83 N variable speed obtained


using a sinusoidal signal of 33.33 to 100 rpm, at a frequency of 2 Hz (Period = 0,5 s),
for a contact EHD.
(a) (b) (c)

Fig. 5. Interferogramele de culoare roșie

(a) (b) (c)

Fig. 5. Channel Hue

(c)

(a) (b)
DINY_1 = imread('dy1 02.jpg');
DINY_2 = imread('dy1 05.jpg');
DINY_3 = imread('dy1 09.jpg');

RED_1 = DINY_1(:,:,1);
GREEN_1 = DINY_1(:,:,2);
BLUE_1 = DINY_1(:,:,3);

RED_2 = DINY_2(:,:,1);
GREEN_2 = DINY_2(:,:,2);
BLUE_2 = DINY_2(:,:,3);

RED_3 = DINY_3(:,:,1);
GREEN_3 = DINY_3(:,:,2);
BLUE_3 = DINY_3(:,:,3);

figure
imagesc(RED_1,[0 255]);
imagesc(GREEN_1,[0 255]);
imagesc(BLUE_1,[0 255]);
xlabel('position [386]')
ylabel('position [420]')

figure
imagesc(RED_2,[0 255]);
imagesc(GREEN_2,[0 255]);
imagesc(BLUE_2,[0 255]);
xlabel('position [386]')
ylabel('position [420]')

figure
imagesc(RED_3,[0 255]);
imagesc(GREEN_3,[0 255]);
imagesc(BLUE_3,[0 255]);
xlabel('position [386]')
ylabel('position [420]')

RED_1 = double(RED_1);
GREEN_1 = double(GREEN_1);
BLUE_1 = double(BLUE_1);

RED_2 = double(RED_2);
GREEN_2 = double(GREEN_2);
BLUE_2 = double(BLUE_2);

RED_3 = double(RED_3);
GREEN_3 = double(GREEN_3);
BLUE_3 = double(BLUE_3);

CenterLine_RED_1 = RED_1(600:600,1:1599);
CenterLine_GREEN_1 = GREEN_1(600:600,1:1599);
CenterLine_BLUE_1 = BLUE_1(600:600,1:1599);

CenterLine_RED_2 = RED_2(600:600,1:1599);
CenterLine_GREEN_2 = GREEN_2(600:600,1:1599);
CenterLine_BLUE_2 = BLUE_2(600:600,1:1599);

CenterLine_RED_3 = RED_3(600:600,1:1599);
CenterLine_GREEN_3 = GREEN_3(600:600,1:1599);
CenterLine_BLUE_3 = BLUE_3(600:600,1:1599);

figure
plot(1:1:1599,CenterLine_RED_1,'r-',1:1:1599,CenterLine_GREEN_1,'g-',1:1:1599,CenterLine_BLUE_1,'b-');
xlabel('position [386]')
ylabel('signal [420]')

figure
plot(1:1:1599,CenterLine_RED_2,'r-',1:1:1599,CenterLine_GREEN_2,'g-',1:1:1599,CenterLine_BLUE_2,'b-');
xlabel('position [386]')
ylabel('signal [420]')
figure
plot(1:1:1599,CenterLine_RED_3,'r-',1:1:1599,CenterLine_GREEN_3,'g-',1:1:1599,CenterLine_BLUE_3,'b-');
xlabel('position [386]')
ylabel('signal [420]')

ROI_RED_1 = RED_1((600-100):(600+100),1:1599);
ROI_GREEN_1 = GREEN_1((600-100):(600+100),1:1599);
ROI_BLUE_1 = BLUE_1((600-100):(600+100),1:1599);

ROI_RED_2 = RED_2((600-100):(600+100),1:1599);
ROI_GREEN_2 = GREEN_2((600-100):(600+100),1:1599);
ROI_BLUE_2 = BLUE_2((600-100):(600+100),1:1599);

ROI_RED_3 = RED_3((600-100):(600+100),1:1599);
ROI_GREEN_3 = GREEN_3((600-100):(600+100),1:1599);
ROI_BLUE_3 = BLUE_3((600-100):(600+100),1:1599);

N_Avg_RED_1 = mean (ROI_RED_1);


N_Avg_GREEN_1 = mean (ROI_GREEN_1);
N_Avg_BLUE_1 = mean (ROI_BLUE_1);

N_Avg_RED_2 = mean (ROI_RED_2);


N_Avg_GREEN_2 = mean (ROI_GREEN_2);
N_Avg_BLUE_2 = mean (ROI_BLUE_2);

N_Avg_RED_3 = mean (ROI_RED_3);


N_Avg_GREEN_3 = mean (ROI_GREEN_3);
N_Avg_BLUE_3 = mean (ROI_BLUE_3);

figure
plot(1:1:1599,N_Avg_RED_1,'r-',1:1:1599,N_Avg_GREEN_1,'g-',1:1:1599,N_Avg_BLUE_1,'b-');
xlabel('position [386]')
ylabel('signal [420]')

figure
plot(1:1:1599,N_Avg_RED_2,'r-',1:1:1599,N_Avg_GREEN_2,'g-',1:1:1599,N_Avg_BLUE_2,'b-');
xlabel('position [386]')
ylabel('signal [420]')

figure
plot(1:1:1599,N_Avg_RED_3,'r-',1:1:1599,N_Avg_GREEN_3,'g-',1:1:1599,N_Avg_BLUE_3,'b-');
xlabel('position [386]')
ylabel('signal [420]')

% Read image 1
I_1 = imread('dy1 02.jpg');
RGB = I_1
HSV = rgb2hsv(RGB);
% select a channel
H_1 = HSV(:,:,1);
%plot the channel
figure
imagesc(H_1,[0 255]);
xlabel('position [386]')
ylabel('position [420]')
% format conversion
H_1 = double(H_1);
% select a line of interest ROI (1 x 1600), here center line
CenterLine_Hue = H_1(600:600,1:1599);
%plot a single line
figure
plot(CenterLine_Hue);
xlabel('position [386]')
ylabel('signal [420]')
%average over several lines (vertical)
% select a region of interest ROI with several number of lines N (N x 1600), here 200 lines are averaged
ROI_H_1 = H_1((600-100):(600+100),1:1599);
%caculate the mean of the RIO obver several rows
N_Avg_H_1 = mean (ROI_H_1);
%plot the averaged line
figure
plot(N_Avg_H_1);
xlabel('position [386]')
ylabel('signal [420]')

% Read image 1
I_1 = imread('dy1 02.jpg');
RGB = I_1
HSV = rgb2hsv(RGB);
% select a channel
S_1 = HSV(:,:,2);
%plot the channel
figure
imagesc(S_1,[0 255]);
xlabel('position [386]')
ylabel('position [420]')
% format conversion
S_1 = double(S_1);
% select a line of interest ROI (1 x 1600), here center line
CenterLine_Saturation = S_1(600:600,1:1599);
%plot a single line
figure
plot(CenterLine_Saturation);
xlabel('position [386]')
ylabel('signal [420]')
%average over several lines (vertical)
% select a region of interest ROI with several number of lines N (N x 1600), here 200 lines are averaged
ROI_S_1 = S_1((600-100):(600+100),1:1599);
%caculate the mean of the RIO obver several rows
N_Avg_S_1 = mean (ROI_S_1);
%plot the averaged line
figure
plot(N_Avg_S_1);
xlabel('position [386]')
ylabel('signal [420]')

% Read image 1
I_1 = imread('dy1 02.jpg');
RGB = I_1
HSV = rgb2hsv(RGB);
% select a channel
V_1 = HSV(:,:,3);
%plot the channel
figure
imagesc(V_1,[0 255]);
xlabel('position [386]')
ylabel('position [420]')
% format conversion
V_1 = double(V_1);
% select a line of interest ROI (1 x 1600), here center line
CenterLine_Value = S_1(600:600,1:1599);
%plot a single line
figure
plot(CenterLine_Value);
xlabel('position [386]')
ylabel('signal [420]')
%average over several lines (vertical)
% select a region of interest ROI with several number of lines N (N x 1600), here 200 lines are averaged
ROI_V_1 = V_1((600-100):(600+100),1:1599);
%caculate the mean of the RIO obver several rows
N_Avg_V_1 = mean (ROI_V_1);
%plot the averaged line
figure
plot(N_Avg_V_1);
xlabel('position [386]')
ylabel('signal [420]')

% Read image 2
I_2 = imread('dy1 05.jpg');
RGB = I_2
HSV = rgb2hsv(RGB);
% select a channel
H_2 = HSV(:,:,1);
%plot the channel
figure
imagesc(H_2,[0 255]);
xlabel('position [386]')
ylabel('position [420]')
% format conversion
H_2 = double(H_2);
% select a line of interest ROI (1 x 1600), here center line
CenterLine_Hue = H_2(600:600,1:1599);
%plot a single line
figure
plot(CenterLine_Hue);
xlabel('position [386]')
ylabel('signal [420]')
%average over several lines (vertical)
% select a region of interest ROI with several number of lines N (N x 1600), here 200 lines are averaged
ROI_H_2 = H_2((600-100):(600+100),1:1599);
%caculate the mean of the RIO obver several rows
N_Avg_H_2 = mean (ROI_H_2);
%plot the averaged line
figure
plot(N_Avg_H_2);
xlabel('position [386]')
ylabel('signal [420]')

% Read image 3
I_3 = imread('dy1 09.jpg');
RGB = I_3
HSV = rgb2hsv(RGB);
% select a channel
H_3 = HSV(:,:,1);
%plot the channel
figure
imagesc(H_3,[0 255]);
xlabel('position [386]')
ylabel('position [420]')
% format conversion
H_3 = double(H_3);
% select a line of interest ROI (1 x 1600), here center line
CenterLine_Hue = H_3(600:600,1:1599);
%plot a single line
figure
plot(CenterLine_Hue);
xlabel('position [386]')
ylabel('signal [420]')
%average over several lines (vertical)
% select a region of interest ROI with several number of lines N (N x 1600), here 200 lines are averaged
ROI_H_3 = H_3((600-100):(600+100),1:1599);
%caculate the mean of the RIO obver several rows
N_Avg_H_3 = mean (ROI_H_3);
%plot the averaged line
figure
plot(N_Avg_H_3);
xlabel('position [386]')
ylabel('signal [420]')

% Read image 4
I_4 = imread('dy1 13.jpg');
RGB = I_4
HSV = rgb2hsv(RGB);
% select a channel
H_4 = HSV(:,:,1);
%plot the channel
figure
imagesc(H_4,[0 255]);
xlabel('position [386]')
ylabel('position [420]')
% format conversion
H_4 = double(H_4);
% select a line of interest ROI (1 x 1600), here center line
CenterLine_Hue = H_4(600:600,1:1599);
%plot a single line
figure
plot(CenterLine_Hue);
xlabel('position [386]')
ylabel('signal [420]')
%average over several lines (vertical)
% select a region of interest ROI with several number of lines N (N x 1600), here 200 lines are averaged
ROI_H_4 = H_4((600-100):(600+100),1:1599);
%caculate the mean of the RIO obver several rows
N_Avg_H_4 = mean (ROI_H_4);
%plot the averaged line
figure
plot(N_Avg_H_4);
xlabel('position [386]')
ylabel('signal [420]')

YCbCr
% Read image 1
I_1 = imread('dy1 02.jpg');
RGB = I_1
YCbCr = rgb2ycbcr(RGB);
% select a channel
Y_1 = YCbCr(:,:,1);
%plot the channel
figure
imagesc(Y_1,[0 255]);
xlabel('position [386]')
ylabel('position [420]')
% format conversion
Y_1 = double(Y_1);
% select a line of interest ROI (1 x 1600), here center line
CenterLine_Y = Y_1(600:600,1:1599);
%plot a single line
figure
plot(CenterLine_Y);
xlabel('position [386]')
ylabel('signal [420]')
%average over several lines (vertical)
% select a region of interest ROI with several number of lines N (N x 1600), here 200 lines are averaged
ROI_Y_1 = Y_1((600-100):(600+100),1:1599);
%caculate the mean of the RIO obver several rows
N_Avg_Y_1 = mean (ROI_Y_1);
%plot the averaged line
figure
plot(N_Avg_Y_1);
xlabel('position [386]')
ylabel('signal [420]')

% Read image 1
I_1 = imread('dy1 02.jpg');
RGB = I_1
YCbCr = rgb2ycbcr(RGB);
% select a channel
Cb_1 = YCbCr(:,:,2);
%plot the channel
figure
imagesc(Cb_1,[0 255]);
xlabel('position [386]')
ylabel('position [420]')
% format conversion
Cb_1 = double(Cb_1);
% select a line of interest ROI (1 x 1600), here center line
CenterLine_Cb = Cb_1(600:600,1:1599);
%plot a single line
figure
plot(CenterLine_Cb);
xlabel('position [386]')
ylabel('signal [420]')
%average over several lines (vertical)
% select a region of interest ROI with several number of lines N (N x 1600), here 200 lines are averaged
ROI_Cb_1 = Cb_1((600-100):(600+100),1:1599);
%caculate the mean of the RIO obver several rows
N_Avg_Cb_1 = mean (ROI_Cb_1);
%plot the averaged line
figure
plot(N_Avg_Cb_1);
xlabel('position [386]')
ylabel('signal [420]')

% Read image 1
I_1 = imread('dy1 02.jpg');
RGB = I_1
YCbCr = rgb2ycbcr(RGB);
% select a channel
Cr_1 = YCbCr(:,:,3);
%plot the channel
figure
imagesc(Cr_1,[0 255]);
xlabel('position [386]')
ylabel('position [420]')
% format conversion
Cr_1 = double(Cr_1);
% select a line of interest ROI (1 x 1600), here center line
CenterLine_Cr = Cr_1(600:600,1:1599);
%plot a single line
figure
plot(CenterLine_Cr);
xlabel('position [386]')
ylabel('signal [420]')
%average over several lines (vertical)
% select a region of interest ROI with several number of lines N (N x 1600), here 200 lines are averaged
ROI_Cr_1 = Cr_1((600-100):(600+100),1:1599);
%caculate the mean of the RIO obver several rows
N_Avg_Cr_1 = mean (ROI_Cr_1);
%plot the averaged line
figure
plot(N_Avg_Cr_1);
xlabel('position [386]')
ylabel('signal [420]')

CMY
% Read image 1
I_1 = imread('dy1 02.jpg');
RGB = I_1
% select a channel
R_1 = RGB(:,:,1);
%plot the channel
figure
imagesc(R_1,[0 255]);
xlabel('position [386]')
ylabel('position [420]')
% format conversion
R_1 = double(R_1);
C_1 = 1 - ( R_1 / 255 );
% select a line of interest ROI (1 x 1600), here center line
CenterLine_Cyan = C_1(600:600,1:1599);
%plot a single line
figure
plot(CenterLine_Cyan);
xlabel('position [386]')
ylabel('signal [420]')
%average over several lines (vertical)
% select a region of interest ROI with several number of lines N (N x 1600), here 200 lines are averaged
ROI_C_1 = C_1((600-100):(600+100),1:1599);
%caculate the mean of the RIO obver several rows
N_Avg_C_1 = mean (ROI_C_1);
%plot the averaged line
figure
plot(N_Avg_C_1);
xlabel('position [386]')
ylabel('signal [420]')

% Read image 1
I_1 = imread('dy1 02.jpg');
RGB = I_1
% select a channel
G_1 = RGB(:,:,2);
%plot the channel
figure
imagesc(G_1,[0 255]);
xlabel('position [386]')
ylabel('position [420]')
% format conversion
G_1 = double(G_1);
M_1 = 1 - ( G_1 / 255 );
% select a line of interest ROI (1 x 1600), here center line
CenterLine_Magenta = M_1(600:600,1:1599);
%plot a single line
figure
plot(CenterLine_Magenta);
xlabel('position [386]')
ylabel('signal [420]')
%average over several lines (vertical)
% select a region of interest ROI with several number of lines N (N x 1600), here 200 lines are averaged
ROI_M_1 = M_1((600-100):(600+100),1:1599);
%caculate the mean of the RIO obver several rows
N_Avg_M_1 = mean (ROI_M_1);
%plot the averaged line
figure
plot(N_Avg_M_1);
xlabel('position [386]')
ylabel('signal [420]')

% Read image 1
I_1 = imread('dy1 02.jpg');
RGB = I_1
% select a channel
B_1 = RGB(:,:,3);
%plot the channel
figure
imagesc(B_1,[0 255]);
xlabel('position [386]')
ylabel('position [420]')
% format conversion
B_1 = double(B_1);
Y_1 = 1 - ( B_1 / 255 );
% select a line of interest ROI (1 x 1600), here center line
CenterLine_Yellow = Y_1(600:600,1:1599);
%plot a single line
figure
plot(CenterLine_Yellow);
xlabel('position [386]')
ylabel('signal [420]')
%average over several lines (vertical)
% select a region of interest ROI with several number of lines N (N x 1600), here 200 lines are averaged
ROI_Y_1 = Y_1((600-100):(600+100),1:1599);
%caculate the mean of the RIO obver several rows
N_Avg_Y_1 = mean (ROI_Y_1);
%plot the averaged line
figure
plot(N_Avg_Y_1);
xlabel('position [386]')
ylabel('signal [420]')

FAZA WRAPPED ȘI UNWRAPPED RGB

I1_8b = imread('dy1 02.jpg');


RGB1 = I1_8b;
A1 = rgb2gray(RGB1);
A = double(A1);
filter = fspecial('average',[7 7]);
i1 = conv2(A, filter);
I2_8b = imread('dy1 05.jpg');
RGB2 = I2_8b;
B1 = rgb2gray(RGB2);
B = double(B1);
filter = fspecial('average',[7 7]);
i2 = conv2(B, filter);

I3_8b = imread('dy1 09.jpg');


RGB3 = I3_8b;
C1 = rgb2gray(RGB3);
C = double(C1);
filter = fspecial('average',[7 7]);
i3 = conv2(C, filter);

WrappedPhase = atan2(1.732*(i1-i3),2*i1-i2-i3);
figure(1);
colormap(gray(256))
imagesc(WrappedPhase);
N = 386;
M = 420;
U1_unwrapped = WrappedPhase;
for i=1:N
j=1:M
U1_unwrapped(i,j) = unwrap(U1_unwrapped(i,j));
end
%Then sequentially unwrap all the columns one at a time
for j=1:M
i=1:N
U1_unwrapped(j,i) = unwrap(U1_unwrapped(j,i));
end

figure
colormap(gray(256));
imagesc(U1_unwrapped);
% title('Unwrapped phase image using the Itoh algorithm: the first method')
xlabel('386');
ylabel('420')
figure
surf(U1_unwrapped,'FaceColor','interp', 'EdgeColor','none', 'FaceLighting','phong');
view(-30,30), camlight left, axis tight;
%title('Unwrapped phase image using the Itoh algorithm: the first method')
xlabel('386');
ylabel('420');
zlabel('2*Pi');
imagesc(U1_unwrapped);

U2_unwrapped = WrappedPhase;
for i=1:N
U2_unwrapped(:,i) = unwrap(U2_unwrapped(:,i));
end
%Then sequentially unwrap all the columns one at a time
for j=1:M
U2_unwrapped(j,:) = unwrap(U2_unwrapped(j,:));
end

figure
colormap(gray(256));
imagesc(U2_unwrapped);
% title('Unwrapped phase image using the Itoh algorithm: the second method')
xlabel('386');
ylabel('420')
figure
surf(U2_unwrapped,'FaceColor','interp', 'EdgeColor','none', 'FaceLighting','phong');
view(-30,30), camlight left, axis tight;
%title('Unwrapped phase image using the Itoh algorithm: the second method')
xlabel('386');
ylabel('420');
zlabel('2*Pi');

FAZA WRAPPED ȘI UNWRAPPED HSV

I1_8b = imread('dy1 02.jpg');


RGB1 = I1_8b;
HSV1 = rgb2hsv(RGB1);
H_1 = rgb2gray(HSV1);
H_1 = HSV1(:,:,1);
%plot the channel
figure
imagesc(H_1,[0 255]);
xlabel('position [386]')
ylabel('position [420]')
% format conversion
H1 = double(H_1);
filter = fspecial('average',[7 7]);
i1 = conv2(H1, filter);
I2_8b = imread('dy1 05.jpg');
RGB2 = I2_8b;
HSV2 = rgb2hsv(RGB2);
H_2 = rgb2gray(HSV2);
H_2 = HSV2(:,:,1);
%plot the channel
figure
imagesc(H_2,[0 255]);
xlabel('position [386]')
ylabel('position [420]')
% format conversion
H2 = double(H_2);
filter = fspecial('average',[7 7]);
i2 = conv2(H2, filter);

I3_8b = imread('dy1 09.jpg');


RGB3 = I3_8b;
HSV3 = rgb2hsv(RGB3);
H_3 = rgb2gray(HSV3);
H_3 = HSV3(:,:,1);
%plot the channel
figure
imagesc(H_3,[0 255]);
xlabel('position [386]')
ylabel('position [420]')
% format conversion
H3 = double(H_3);
filter = fspecial('average',[7 7]);
i3 = conv2(H3, filter);

WrappedPhase = atan2(1.732*(i1-i3),2*i1-i2-i3);
figure(1);
colormap(gray(256))
imagesc(WrappedPhase);
N = 386;
M = 420;
U1_unwrapped = WrappedPhase;
for i=1:N
U1_unwrapped(i,:) = unwrap(U1_unwrapped(i,:));
end
%Then sequentially unwrap all the columns one at a time
for j=1:M
U1_unwrapped(:,j) = unwrap(U1_unwrapped(:,j));
end

figure
colormap(gray(256));
imagesc(U1_unwrapped);
% title('Unwrapped phase image using the Itoh algorithm: the first method')
xlabel('386');
ylabel('420')
surf(U1_unwrapped,'FaceColor','interp', 'EdgeColor','none', 'FaceLighting','phong');
view(-10,10) camlight left, axis tight;

U2_unwrapped = WrappedPhase;
for i=1:N
U2_unwrapped(:,i) = unwrap(U2_unwrapped(:,i));
end
%Then sequentially unwrap all the columns one at a time
for i=1:M
U2_unwrapped(j,:) = unwrap(U2_unwrapped(j,:));
end

figure
colormap(gray(256));
imagesc(U2_unwrapped);
% title('Unwrapped phase image using the Itoh algorithm: the first method')
xlabel('386');
ylabel('420')
figure
surf(U2_unwrapped,'FaceColor','interp', 'EdgeColor','none', 'FaceLighting','phong');
view(-10,10), camlight left, axis tight;

You might also like