function color = detect_color(CARD)
    if abs(CARD(:,:,1)-CARD(:,:,2)) < 70
        color = 'B';
    else
        color = 'R';
    end
end