Software > Software

Beginner Image Recognition

(1/1)

stalepretzel:
Hello, I am interested in image recognition, and I'd like to begin with some elementary image transformations.  I have a basic understanding of the concepts, but i don't know how to turn something like a bitmap into a convenient little matrix :).  I'm trying to open small bitmaps up in notepad (and attempt to decipher the strings of text), but I'd like to know how everyone else does it.  Thanks. 

dunk:
so i'm not sure about bitmaps but for .png and .jpeg formats there are libraries to convert the image into nice (x,y) arrays for most programing languages.
i know these exist for c++ and python.
you can probably find similar for bitmaps and programing languages with a bit of searching.

dunk.

Somchaya:
Hmm for most (all?) image formats, it starts off with a header of some sort, that describes the width/height of the image, and other things, and then comes all the actual pixel information. Depending on the image format, and settings (for eg bmp has multiple different settings, like 8 bits per pixel, 16, 24, 32 etc), the data information has to be interpreted differently.

The easiest way to do this would be to find some image loading code online in the language of your choice and look through it. Of course, having a tutorial that tells you the file structure is very useful (wikipedia usually has good information).

If you're doing it in java, the ImageIO class is capable of loading images from disk, and you can retrieve the pixel information from an Image class it returns. I'm pretty sure code like this exists for most other common languages though.

Navigation

[0] Message Index

Go to full version