-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmain_cap.m
executable file
·50 lines (31 loc) · 1.38 KB
/
main_cap.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
clear;
clc;
close all;
cd 'C:\Users\larkz\Desktop\Adsorption_Lab\9-01';
I = imread('bottom.JPG'); %read original RGB image
thresh_inc = 0.1;
threshold = graythresh(I) + thresh_inc;
BW = im2bw(I, threshold);
imshow(BW); hold on;
col_str_para = input('Input X Coord for parabola: ', 's');
row_str_para = input('Input Y Coord for parabola: ', 's');
trace_comp = input('Input trace compass direc? : ', 's');
c_cc = input('Clockwise or counterclockwise?: ', 's');
length_str = input('Length of Parabola Trace: ', 's');
Y_line_cood_str = input('Y Line cood?: ', 's');
column_initial = str2num(col_str_para); %Represents X coord
row_initial = str2num(row_str_para); %Represents Y coord
ini_p = [row_initial, column_initial];
Y_line_cood = str2num(Y_line_cood_str);
if (isempty(length_str))
para_length = 400;
else
para_length = str2double(length_str); %boundary length
end
if (isempty(c_cc))
c_cc = 'clockwise';
end
cd C:\Users\larkz\Desktop\Adsorption_Lab\Capillary_Detection;
[avg_ang, angle_lef, angle_rig, h_angle, pix_height] = find_angle_cap(I, BW, ini_p, trace_comp, para_length, c_cc, Y_line_cood);
avg_ang
h_angle