Skip to content

Commit b99964c

Browse files
committed
Added matlab own version of anaglyph generation
1 parent d3f5522 commit b99964c

File tree

5 files changed

+15
-666
lines changed

5 files changed

+15
-666
lines changed

Stereoscopy/stereoscopy_script.m

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,18 @@
153153
anaglyph_synth = uint8(leftImage_synth+rightImage_synth);
154154
figure,image(anaglyph_synth), title('Synthesized Anaglyph')
155155

156-
function paddedMatrix = paddingZeros(matrix, divisor)
157-
%paddedMatrix = zeros(size(matrix,1), size(matrix,2), size(matrix,3));
158-
rows = size(matrix,1);
159-
cols = size(matrix,2);
160-
paddedMatrix = wextend('ar','sym',matrix, round(rows/divisor)*divisor - rows, 'd');
161-
paddedMatrix = wextend('ac','sym',paddedMatrix, round(cols/divisor)*divisor - cols, 'l');
162-
end
156+
%%% WIP %%%%%%
157+
% Encode each eye's image using filters of different (usually chromatically opposite) colors, red and blue
158+
rightImage_synth = imtranslate(rightImage_synth,[10, 0]);
159+
160+
figure,image(uint8(rightImage_synth)), title('Anaglyph Synth');
161+
r = zeros(size(rightImage_synth));
162+
gb = zeros(size(leftImage_synth));
163+
r(:,:,1) = double(rightImage_synth(:,:,1));
164+
gb(:,:,2:3) = double(leftImage_synth(:,:,2:3));
165+
anaglyph = uint8(r+gb);
166+
figure,image(anaglyph), title('Anaglyph Synth');
167+
168+
% Create stereo anaglyph with Matlab function to check the result
169+
J = stereoAnaglyph(leftImage_synth, rightImage_synth);
170+
figure, image(uint8(J)), title('Anaglyph using Matlab function')

Stereoscopy/stereoscopy_script_BACKUP_25220.m

Lines changed: 0 additions & 183 deletions
This file was deleted.

Stereoscopy/stereoscopy_script_BASE_25220.m

Lines changed: 0 additions & 153 deletions
This file was deleted.

0 commit comments

Comments
 (0)