Jpeg Analyzer

13
Jpeg Analyzer Ben Applegate CSS497 Advisor: Dr. Munehiro Fukuda

description

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 - PowerPoint PPT Presentation

Transcript of Jpeg Analyzer

Page 1: Jpeg Analyzer

Jpeg Analyzer

Ben Applegate CSS497Advisor: Dr. Munehiro Fukuda

Page 2: Jpeg Analyzer

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.

• ParkingWebcams 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.

Page 3: Jpeg Analyzer

Agriculture

Sort images according to amount of red, as compared to a baseline photo

Page 4: Jpeg Analyzer

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( );

}

func2( )

func2( )

func2( )

func2( )

func1( ) func1( )func1( )func1( )

func1( ) … …

func3( )

func3( )

Page 5: Jpeg Analyzer

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

Page 6: Jpeg Analyzer

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

Page 7: Jpeg Analyzer

Entropy Coding

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

Image source: Wikipedia

Page 8: Jpeg Analyzer

Human Vision

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

CrCbY

Image source: NASA

Page 9: Jpeg Analyzer

Chroma Subsampling

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

Page 10: Jpeg Analyzer

JPEG MCU

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

Image source: NASA

Page 11: Jpeg Analyzer

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

Page 12: Jpeg Analyzer

Results

As expected, analysis time decreased logarithmically as processes were increased

Page 13: Jpeg Analyzer

Future

• Optimize IDCT• Extend functionality to other chroma subsampling ratios• Improve fault tolerance• Optimize MASS calls by observing network overhead

o Send multiple MCUs to each node• Analyze image data using Munsell color codes

 Web search and apple tree pictures