Applied Math & Computer Science Lab
Data Analysis, Optimization & Mathematical Modeling, Artificial Intelligence, Neural Net For Everyday Life Applications
AI/Data Mining Links Online Free Courses Online Bookstore AMCSL Forum Submit Link New Additions Archive
Practical Data Mining Courses      Get Certificate of Completion Now for Free   
Search the Web:    

Converting Image to Digital Data

Data mining algorithms don't operate with images directly. Before doing any data mining the images should be converted to numerical data understandable by computer. This article will consider how it can be done using perl and perl module Image::Magick.

ImageMagick is a software suite to create, edit, and compose bitmap images. It can do different operations with images in a many formats. Perl has module PerlMagick so the perl script can use the functionality of ImageMagick software. If you have web hosting account most likely your web host already has everything installled. If you need you can find installation instructions at [2].
The function that does main job is GetPixels. Using it the script can get data for each pixel in digital format for images in many file formats. The example script is using GIF image file. Here is the line from the the example script where this function is used:






This function gets image pixels as defined by the map. The example script is using "RGB" map. You can find descriptions of color models at [3], [4]. For each pixel the function extract intensities from the image and then the script put the data to the output.

Thus the example script showed how the image can be converted to digital data understandable by computer and data mining algorithms. Once it's converted to numerical data it's ready for data mining.



References



1. Converting image to numerical data - perl script

2. PerlMagick, Perl API for ImageMagick
3. RGB color model
4. RGBA color model