Event reconstruction using pattern spectra and convolutional neural networks for the Cherenkov Telescope Array