a | b/matlab/highlight.m | ||
---|---|---|---|
1 | function out = highlight(image_file, csv_file) |
||
2 | |||
3 | % load image and csv files |
||
4 | A = imread(image_file); |
||
5 | M = csvread(csv_file); |
||
6 | for i=1:3 |
||
7 | B(:,:,i) = rgb2gray(A); |
||
8 | end |
||
9 | [p, q] = size(M); |
||
10 | for i=1:p |
||
11 | for j=1:q/2 |
||
12 | if M(i,2*j) ~= 0 |
||
13 | col = M(i,2*j-1); |
||
14 | row = M(i,2*j); |
||
15 | B(row,col) = A(row,col); |
||
16 | end |
||
17 | end |
||
18 | end |
||
19 | |||
20 | out = B; |
||
21 | |||
22 | end |