130 likes | 266 Views
Jpeg Analyzer. Ben Applegate CSS497 Advisor: Dr. Munehiro Fukuda. Purpose of Research. Create a JPEG analysis program that will run on the UWB Parallel Computing lab's cluster. Potential uses: Agriculture
E N D
Jpeg Analyzer Ben Applegate CSS497 Advisor: Dr. Munehiro Fukuda
Purpose of Research Create a JPEG analysis program that will run on the UWB Parallel Computing lab's cluster. Potential uses: • Agriculture Webcam images can be analyzed for fruit that is ready to be harvested. Workers can then save time by only going to areas that have fruit. • Parking Webcams can be placed in a parking garage, and their images can be used to identify areas with open spaces. • Web Search Images can be found over the web that are similar to an input image. Images can be analyzed, then stored as keywords to be used in searches.
Agriculture Sort images according to amount of red, as compared to a baseline photo
func1( ) func1( ) func1( ) func1( ) func2( ) func1( ) … … func2( ) func2( ) func3( ) func2( ) func3( ) What is MASS Public static void main( String[ ] args ) { MASS.init( args ); Places space = new Places( handle, “MySpace”, params, xSize, ySize); Agents agents = new Agents( handle, “MyAgents”, params, space, population ); space.callAll( MySpace.func1, params ); space.exchangeAll( MySpace.func2, neighbors ); agents.exchangeAll( MyAgents.func3 ); agents.manageAll( ); MASS.finish( ); }
JPEG image format Created to store the maximum amount of visual data in the least amount of space Three strategies - • Discrete Cosine Transform • Entropy Coding • Human Vision
Discrete Cosine Transfom The DCT stores cosine waves reducing them to a set of coefficients JPEG uses an 8x8 DCT Stores each visual band as a wave Image source: Wikipedia
DCT information is stored using huffman encoding Values are stored in a zig zag pattern to minimize space Higher frequencies tend to go to zero, so the zig zag can terminate quickly Entropy Coding Image source: Wikipedia
The human eye can better detect differences in light and dark than in color. RGB is converted to YCbCr Y is the luminance Cb and Cr are the chrominance values, and can be sub-sampled RGB Human Vision Y Cb Cr Image source: NASA
Averages Cb and Cr values to save space Common sampling ratios are 2 x 1 : Horizontal 2 x 2 : Horizontal and vertical Cheap cameras (i.e. webcams) mostly use 2x2 Chroma Subsampling
MCU : Minimum Coded Unit This is the smallest amount of data that can be coded in a given jpeg. Size depends on subsampling 2x1 = 16px by 8 px 2x2 = 16px by 16px JPEG MCU Image source: NASA
Strategy • Decode MCUs from huffman values • Send individual MCUs to MASS to be decoded in parallel using the Inverse DCT: The IDCT (like the DCT) requires 64 calculations per pixel • Return pixel arrays • Rebuild the pixel arrays into the image Image source: Wikipedia
Results As expected, analysis time decreased logarithmically as processes were increased
Future • Optimize IDCT • Extend functionality to other chroma subsampling ratios • Improve fault tolerance • Optimize MASS calls by observing network overhead • Send multiple MCUs to each node • Analyze image data using Munsell color codes Web search and apple tree pictures