https://bitbucket.org/daniel_fort/magic-lantern
Raw File
Tip revision: 22238632e9e49f207595ed03024791b4c5834beb authored by Bilal Fakhouri on 02 July 2018, 22:58:09 UTC
crop_rec.c Added new preset "mv1080 in EOS M" it's worked for patching mv1080 into mv720 in Canon 700D ,, and the two cameras shares the same values but it didn't work for EOS M the resolution stayed 1736x696 unlike in canon 700D 1736x1158 .
Tip revision: 2223863
defish-lut16.m
#!/usr/bin/env octave3.2

prefix = argv(){1};

xy = double(imread([prefix ".tif"]));

% smooth the image a bit to fake 16-bit data
x = -4:4; y = -4:4;
[x,y] = meshgrid(x,y);
r = sqrt(x.^2 + y.^2);

%~ % try to find an optimum smoothing factor that preserves a straight line
%~ E = [];
%~ F = linspace(1,10,100);
%~ for f = F,
	%~ %B = sinc(r/f);
	%~ B = cos(r/f); 
	%~ B(B<0) = 0; B /= sum(B(:)); 
	%~ xyf = filter2(B, xy(1:150,1:150)); 
	%~ 
	%~ yp = xyf(100, 10:100); xp = 1:length(yp);
	%~ a = polyfit(xp,yp,1);
	%~ yps = a(1)*xp + a(2);
	%~ e = norm(yp-yps);
	%~ E(end+1) = e;
%~ end
%~ plot(E);
%~ [m,i] = min(E);
%~ [F(i), m]

B = cos(r/3.3); 
B(B<0) = 0; B /= sum(B(:)); 
xyf = filter2(B, xy); 

%~ B = ones(7); B /= sum(B(:));
%~ xyf = filter2(B, xy);
%~ figure(2), plot(xyf(100, 10:50))

xyf = xyf(1:4:end, 1:4:end); % resize to 720x480
%~ size(xyf)

%~ plot(xy(240,:)), hold on, plot(xyf(240,:),'r')

f = fopen([prefix ".lut"], "wb")
for i = 1:480/2
	for j = 1:720/2
		fwrite(f, [xyf(i,j), xyf(481-i,721-j)] * 256, 'uint16');
	end
end
fclose(f)
back to top