gonzojive

Archive for 2010|Yearly archive page

Cross-compiling OpenCV for iPhone

In Uncategorized on November 24, 2010 at 9:33 pm

If you are here just to cross-compile OpenCV, follow these simple instructions.  The older post is a little more detailed, error-prone, pedantic, and maybe out of date.

If you want to cross-compile OpenCV from source code, you can do by next steps.

  1. Building OpenCV 2.1 requiers CMake. You can easily install it by using MacPorts, or follow the installation instructions at the CMake website.
    % sudo port install cmake
    
  2. Clone this project from github, then move into the project directory
    % git clone git://github.com/gonzojive/iphone_opencv_test.git
    % cd iphone_opencv_test
    
  3. Download the source code for OpenCV from Sourceforge. Save OpenCV-2.1.0.tar.bz2 into the project root.
  4. Use the provided Makefile:
    % make
    

This will extract the downloaded archive, apply a patch to the OpenCV code, generate appropriate cmakefile suport using the opencv_cmake.sh script, and finally make the static libraries for simulator and device.  The libraries will be in the opencv_{device,simulator} directories, and may be linked in XCode etc.

Advertisements

In search of state-of-the-art barcode reader software

In Uncategorized on August 3, 2010 at 2:09 am

I have tried out a few different software libraries for scanning ISBN/EAN-13 barcodes with my iSight camera, but I am disappointed by the results.  The input I am providing the software is 640×480, noisy, poorly focused pictures of ISBNs on the backs of my textbooks.  I have concluded that all open source barcode readers are unfit for cheap webcams without further improvement.

I would ideally like to use a $30 webcam to scan books and other products with off-the-shelf open-source software, for use in some inventory management software.  They do make specialized barcode scanner hardware for this purpose, but the computer vision enthusiast in me sees no reason why we should not have a good webcam solution in 2010.

Software that could not recognize these images:

  • zxing
  • zbar

Software I did not try:

What’s missing from open-source barcode software: science

It seems like the libraries out there now do not use large quantities of data to test out the algorithms and incrementally improve them.  I am talking about a dataset typical in a supervised learning project with thousands of example images with corresponding labels.  In this case, it would be helpful to have two different classes of examples in a dataset.  For each image, it would be helpful to have

  1. the pixel coordinates of the corners of the barcode image
  2. the barcode value

With this sort of data, we could begin to compare the performance of the barcode libraries out there.  A fairly large dataset could be generated synthetically, or one could be created relatively easily from real-world data as well.  See this thread about using a tex library to generate EAN-13 barcodes.

I don’t have any brilliant insights about how to accomplish great results, but one thing I have noticed is that no library seems to make use of the english characters printed at the bottom of EAN barcodes.  This could probably be used in conjunction with the barcode data to further improve results, since OCR software is super accurate these days.