We describe a new technique for the classification of motor imagery electroencephalogram (EEG) recordings in a brain computer interface (BCI) task. The technique is based on an adaptive time-frequency analysis of EEG signals computed using local discriminant bases (LDB) derived from local cosine packets (LCP). In an offline step, the EEG data obtained from the C-3/C-4 electrode locations of the standard 10/20 system is adaptively segmented in time, over a non-dyadic grid by maximizing the probabilistic distances between expansion coefficients corresponding to left and right hand movement imagery. This is followed by a frequency domain clustering procedure in each adapted time segment to maximize the discrimination power of the resulting time-frequency features. Then, the most discriminant features from the resulting arbitrarily segmented time-frequency plane are sorted. A principal component analysis (PCA) step is applied to reduce the dimensionality of the feature space. This reduced feature set is finally fed to a linear discriminant for classification. The online step simply computes the reduced dimensionality features determined by the offline step and feeds them to the linear discriminant. We provide experimental data to show that the method can adapt to physio-anatomical differences, subject-specific and hemisphere-specific motor imagery patterns. The algorithm was applied to all nine subjects of the BCI Competition 2002. The classification performance of the proposed algorithm varied between 70% and 92.6% across subjects using just two electrodes. The average classification accuracy was 80.6%. For comparison, we also implemented an adaptive autoregressive model based classification procedure that achieved an average error rate of 76.3% on the same subjects, and higher error rates than the proposed approach on each individual subject.