0
$\begingroup$

I'd like to create an image classifier that takes a set of labeled images and creates a classifier to be used on some unknown images. Most of the examples I see assume all images are the same size (m x n pixels), but my training set will have pictures of various sizes. This is a problem because training my classifier will have the following steps:

  1. Load each image into m x n array
  2. Employ some filter
  3. Transform m x n array into 1 x (m * n) array
  4. Feature selection
  5. Train classifier

The different sized images is a problem because step 3 will yield arrays of different lengths if the images don't have the same number of pixels.

I have a background in statistics, not image processing, and I haven't been able to find any general guidelines for how to handle this problem. I'll be working in Python, and it would also be nice to know if there are libraries perform image resizing.

$\endgroup$
0
$\begingroup$

Erik, for dealing with images of different sizes, google SIFT, Scale Invariant Feature Transform. OpenCV has an implementation of SIFT, and you are all set to go.

$\endgroup$
1
$\begingroup$

Not sure about your specific application, but the Viola Jones face detection algorithm successively scans the candidate picture for faces in all possible sizes.

I.e., the algorithm search space is both the object (face) location and its size. The beauty of VJ's "cascade architecture" is that it rejects most hypotheses quickly, thus making the search feasible in real-time.

$\endgroup$
1
$\begingroup$

there isn't really a standard way to perform the task your describing it depends on your choice of features and possibly even your choice of classifier, the simplest answer would be just to resize the image before extracting the features, if your using opencv then this can be achieved using the cvResize function, but as I said it depends entirely on the type of features for instance if your were just using colour and creating colour histograms then you could normalise the histogram by the image size to obtain a feature vector invariant of the image size, other techniques such as bag-of-features can be used to generate scale and rotation invariant features that can be extracted from different sized images.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.