% plotf.m % % loads response function from picture of test chart and plots it % % plots [black and 11 step greyvalues] load ground_truth_d1_response_function_data.mat data_needs_to_be_regenerated=0; if data_needs_to_be_regenerated ff=[]; % accumulate the f values for k = 100:118 %%%k=117; % frame number % k=116 returns last f value closer than 3 sigma to 255, so may be distorted % k=115 seems to be brightest image that's not at risk of distortion %function plotf(k) if ((k<100) | (k>118)) error('must load one of frame 100 to 118') end%if f=loadf(k); q0=.011; % true black % true black then 11 values of steps: q=[.011; .021; .048; .079; .126; .185; .264; .358; .472; .622; .733; .893]; ff=[ff f]; end %for k = 100:118 Q=log(q)/log(cbrt(2)); % plot(Q,ff); QQ=Q*ones(1,19)+ones(12,1)*(0:18); end %if data_needs_to_be_regenerated % plot them individually: plot(Q,ff,'o',Q,ff) axis([-19,0,0,255]) xlabel('Q (Quantity of light)','FontSize',20) % Q=log_cbrt{2}(q) %xlabel('Quantity of light, Q = log(q)','FontSize',20) ylabel('f (response byte)','FontSize',20) title('measured camera response functions)','FontSize',20) ! rm ground_truths_d1_response_functions.eps print ground_truths_d1_response_functions.eps % now plot them all lined up: %Q=log(q)/log(1.2599);plot(Q*ones(1,19)+ones(12,1)*(-18:0),ff) % even better if we do: %Q=log(q)/log(1.27);plot(Q*ones(1,19)+ones(12,1)*(-18:0),ff) % so maybe exposures are a little bit off %Q=log(q)/log(1.27);plot(Q*ones(1,19)+ones(12,1)*(-18:0),ff,'o') Q=log(q)/log(1.26);plot(Q*ones(1,19)+ones(12,1)*(-18:0),ff,'o') axis([-19-18,0,0,255]) xlabel('Q (Quantity of light)','FontSize',20) % Q=log_cbrt{2}(q) %xlabel('Quantity of light, Q = log(q)','FontSize',20) ylabel('f (response byte)','FontSize',20) title('measured camera response function','FontSize',20) grid !rm ground_truth_d1_response_function.eps print ground_truth_d1_response_function.eps % consolidate the data into a single plot % as (x,y) ordered pairs x=reshape(Q*ones(1,19)+ones(12,1)*(-18:0),12*19,1); y=reshape(ff,12*19,1); % sort so we can plot as a continuous function: [xsort, ind]=sort(x); plot(xsort,y(ind)); axis([-19-18,0,0,255]) xlabel('Q (Quantity of light)','FontSize',20) % Q=log_cbrt{2}(q) ylabel('f (response byte)','FontSize',20) title('measured camera response function','FontSize',20) grid !rm ground_truth_d1_response_function_continuous.eps print ground_truth_d1_response_function_continuous.eps