Just as you did for mean, you can easily adapt your code to calculate standard deviation (after you calculated the means). In addition, if you count the number of pixels (width, height) in the loop, even if your images have different sizes you can get the exact number to divide the sum:
R_channel = 0
G_channel = 0
B_channel = 0

total_pixel = 0
for idx in xrange(len(pathDir)):
    filename = pathDir[idx]
    img = imread(os.path.join(filepath, filename))

    total_pixel = total_pixel + img.shape[0] * img.shape[1]

    R_total = R_total + np.sum((img[:, :, 0] - R_mean) ** 2)
    G_total = G_total + np.sum((img[:, :, 1] - G_mean) ** 2)
    B_total = B_total + np.sum((img[:, :, 2] - B_mean) ** 2)

R_std = sqrt(R_total / total_count)
G_std = sqrt(G_total / total_count)
B_std = sqrt(B_total / total_count)