A method of classifying a portion of an image or video using a classifier, the classifier being based upon a set of samples (12, 14) in a data space, wherein each sample of the set of samples comprises classified image data, wherein the set includes a plurality of samples of one class and a plurality of samples of another class, and wherein the portion of the image or video comprises a new sample in the data space, the method comprising: training the classifier by: mapping an angle space to a fixed set of angle vectors and, for each angle vector, finding, for each sample, a candidate hyperplane associated with that angle vector, wherein each candidate hyperplane is a radial distance from an origin point measured along a vector from the origin and normal to the candidate hyperplane, and wherein the direction of the vector is given by the angle vector in the data space; selecting (220, 304), as an optimal pair of hyperplanes, a pair of the candidate hyperplanes associated with one angle vector of the first set of angle vectors on the basis of a distance between pairs of the candidate hyperplanes parallel to each other and the number of samples between the candidate hyperplanes; and determining (112, 222, 306) a classification hyperplane as a hyperplane parallel to and between the optimal pair of hyperplanes, and determining (224, 308) whether the portion of the image or video is in the one class or in the another class based on which side of the classification hyperplane the new sample is located. training the classifier by: mapping an angle space to a fixed set of angle vectors and, for each angle vector, finding, for each sample, a candidate hyperplane associated with that angle vector, wherein each candidate hyperplane is a radial distance from an origin point measured along a vector from the origin and normal to the candidate hyperplane, and wherein the direction of the vector is given by the angle vector in the data space; selecting (220, 304), as an optimal pair of hyperplanes, a pair of the candidate hyperplanes associated with one angle vector of the first set of angle vectors on the basis of a distance between pairs of the candidate hyperplanes parallel to each other and the number of samples between the candidate hyperplanes; and determining (112, 222, 306) a classification hyperplane as a hyperplane parallel to and between the optimal pair of hyperplanes, and mapping an angle space to a fixed set of angle vectors and, for each angle vector, finding, for each sample, a candidate hyperplane associated with that angle vector, wherein each candidate hyperplane is a radial distance from an origin point measured along a vector from the origin and normal to the candidate hyperplane, and wherein the direction of the vector is given by the angle vector in the data space; finding, for each sample, a candidate hyperplane associated with that angle vector, wherein each candidate hyperplane is a radial distance from an origin point measured along a vector from the origin and normal to the candidate hyperplane, and wherein the direction of the vector is given by the angle vector in the data space; selecting (220, 304), as an optimal pair of hyperplanes, a pair of the candidate hyperplanes associated with one angle vector of the first set of angle vectors on the basis of a distance between pairs of the candidate hyperplanes parallel to each other and the number of samples between the candidate hyperplanes; and determining (112, 222, 306) a classification hyperplane as a hyperplane parallel to and between the optimal pair of hyperplanes, and determining (224, 308) whether the portion of the image or video is in the one class or in the another class based on which side of the classification hyperplane the new sample is located.