Skip to content

Commit 1695d65

Browse files
committed
add sth. of Distortion
1 parent 768f5ee commit 1695d65

File tree

7 files changed

+102
-0
lines changed

7 files changed

+102
-0
lines changed

CCM/images/correct.png

9.86 KB
Loading

CCM/src/LCC_CMC.csv

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2.34403,0.00823594,-0.0795542
2+
-1.18042,1.44385,0.0806464
3+
-0.296824,-0.556513,0.909063

CCM/src/LinearCCM.m

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
target_data=csvread('ReferenceColor.csv',1,0);%csvread只能读取纯数据
2+
target_x = target_data(:, 1);
3+
target_y = target_data(:, 2);
4+
target_z = target_data(:, 3);
5+
figure();
6+
scatter3(target_x,target_y,target_z,'.')
7+
hold on;
8+
9+
org_data = csvread('OriginalColor.csv',1,0);%csvread只能读取纯数据
10+
org_x = org_data(:, 1);
11+
org_y = org_data(:, 2);
12+
org_z = org_data(:, 3);
13+
scatter3(org_x, org_y, org_z, '+', 'r');
14+
hold on;
15+
16+
ccm_matrix = csvread('LCC_CMC.csv');
17+
disp(ccm_matrix);
18+
19+
[h, w] = size(target_data);
20+
dst_data = org_data * ccm_matrix;
21+
dst_x = dst_data(:, 1);
22+
dst_y = dst_data(:, 2);
23+
dst_z = dst_data(:, 3);
24+
scatter3(dst_x, dst_y, dst_z, '*', 'g');

CCM/src/OriginalColor.csv

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
67.769234, 82.713142, 100.46955
2+
181.53511, 186.64883, 216.60368
3+
159.15741, 141.07986, 124.69097
4+
95.354218, 122.23018, 106.23146
5+
174.5238, 152.62827, 154.62672
6+
188.81744, 193.14198, 153.38742
7+
136.66556, 163.66556, 213.66556
8+
143.01373, 99.545326, 84.791206
9+
141.53535, 143.53535, 207.53535
10+
75.316498, 67.316498, 74.316498
11+
167.60884, 206.50862, 191.54202
12+
156.63315, 197.10515, 220.51657
13+
87.073593, 51.253246, 37.253246
14+
113.5625, 144.5625, 106.84659
15+
89.024002, 100.10267, 168.964
16+
196.79202, 234.79202, 246.79202
17+
150.71695, 131.71695, 186.71695
18+
143.09068, 119.16986, 73.370369
19+
246.68045, 246.76505, 246.81015
20+
221.03094, 221.35953, 221.35953
21+
178.03017, 180.24138, 179.82471
22+
122.67409, 127.63057, 125.63057
23+
64.360397, 71.360397, 68.360397
24+
18.563095, 26.033333, 20.879763
25+

CCM/src/ReferenceColor.csv

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
70,82,107
2+
129,146,184
3+
153,122,101
4+
69,107,95
5+
173,127,128
6+
171,188,129
7+
56,123,201
8+
166,92,77
9+
97,83,174
10+
104,61,86
11+
75,188,167
12+
55,160,213
13+
143,65,49
14+
80,148,99
15+
59,52,155
16+
52,197,227
17+
147,85,169
18+
167,135,61
19+
242,245,245
20+
201,201,200
21+
162,161,160
22+
121,120,120
23+
86,85,84
24+
54,53,52
10.5 MB
Loading

Distortion/src/calDistortion.m

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
%% --------------------------------
2+
%% author:Fred
3+
%% date: 20220602
4+
%% fuction:
5+
%% note: 注意获取点的左边的顺序
6+
% 获取六个点坐标顺序如下:
7+
% 1--------------3-------------5
8+
% | | |
9+
% 2--------------4-------------6
10+
%% --------------------------------
11+
clc;clear;close all;
12+
13+
% 加载检测图片,路径更改为需要测试的图片的路径
14+
img = imread('./images/117-oldBoard-13M.png');
15+
imshow(img);
16+
17+
% 获取六个点的坐标
18+
[x,y]=ginput(6);
19+
a1 = y(2)-y(1);
20+
b = y(4)-y(3);
21+
a2 = y(6)-y(5);
22+
a = (a1 + a2) / 2;
23+
distortion = (a - b) / b * 100;
24+
strDis = sprintf('TV distortion is: %f %s', distortion, '%');
25+
disp(strDis);
26+

0 commit comments

Comments
 (0)