function suit = detect_suit(CARD)
    suits = load('input/suits.mat');
         
    INV = CARD(:,:,2) < 200;
       
    club = conv2(INV, suits.clubs);
    diamond = conv2(INV, suits.diamonds);
    heart = conv2(INV, suits.hearts);
    spade = conv2(INV, suits.spades);
    
    c_m = max(club(:));
    d_m = max(diamond(:));
    h_m = max(heart(:));
    s_m = max(spade(:));
       
    if detect_color(CARD) == 'R'
        if d_m > h_m
            suit = 'D';
        else
            suit = 'H';
        end
    else
         if c_m > s_m
            suit = 'C';
        else
            suit = 'S';
        end   
    end  
end