Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Gilad_D_Intel
Employee
63 Views

linear and nearest neighbor interpolation

function output = calculateBlackLevel(blStruct, AG, ET)
    blLut = zeros(length(blStruct), size(blStruct{1}.black_level,2));
    etLut = zeros(length(blStruct), 1);

    for k = 1 : length(blStruct)
        bl = blStruct{k};

        if length(bl.analog_gain) == 1
            blLut(k, :) = bl.black_level;
        elseif AG > max(bl.analog_gain) || AG < min(bl.analog_gain)
            blLut(k, :) = interp1(bl.analog_gain, bl.black_level, AG, 'nearest', 'extrap');
        else
            blLut(k, :) = interp1(bl.analog_gain, bl.black_level, AG);
        end

        etLut(k) = bl.exposure_time;
    end

    if length(etLut) == 1
        output = blLut;
    elseif ET > max(etLut) || ET < min(etLut)
        output = interp1(etLut, blLut, ET, 'nearest', 'extrap');
    else
        output = interp1(etLut, blLut, ET);
    end
end

 

here is the matlab code i'm trying to convert, my question is. does ipp have any sort of interpolation functions?

 

0 Kudos
0 Replies
Reply