Confused about number of channels and number of filters

we are using 6 filters so 6 here the number of filters not number of channels and if we break it so each filter is 28x28x3 so that it matches the input channel right?

If input to a conv layer has shape (x, y, n_channels_in), the output has number of channels equal to the number of filters through which the input passes.
Based on the figure, each filter has shape (5, 5, 3) when f=5 and n_channels_in = 3.
(28, 28, 6) refers to the output shape of the conv layer.

So 6 here denotes the number of filters same as we did when we had 2 filters (3,3,3) one for vertical edge and second for horizontal and stack the output of both filters to get image 4x4x2 i got it right?

Sorry. I don’t follow. Please elaborate.

Yes, we have a total of 6 filters in that layer, each of which (as Balaji said) is of shape 5 x 5 x 3. So the total filter shape is 5 x 5 x 3 x 6. The choice of 6 is what Prof Ng calls a “hyperparameter”, meaning a choice that the system designer needs to make. It could have been 4 or 8 or 13, but they decided to make it 6.