% 
% Manfred Klaffenboeck
% a00301042
% University of Vienna
% WS18 - SIP Tutorial 
%           Example Solution DIP-Project4.1
%
% MINUSONE negate every odd-positioned value in an image
%
%   INPUT:
%       image               an image
%   OUTPUT:
%       negated            the negated image (checkerboard-style)
%                           (WARNING: returns 'double' values)


function [negated] = minusOne(image)

    % get the size of the image
    [y,x] = size(image);
    
    % create the negation filter
    fil = checkerboard(y,x);
    
    % convert image to double values
    dimg = cast(image,'double');
    
    % apply filter to image
    negated = dimg.*fil;
end

