Quantcast
Channel: Intel® Software - Intel® Integrated Performance Primitives
Viewing all articles
Browse latest Browse all 1489

linear and nearest neighbor interpolation

$
0
0

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?

 


Viewing all articles
Browse latest Browse all 1489

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>