+ All Categories
Home > Documents > Team Babbage Charles Maingi Seph Newman Jon Rollman Nils Schlupp.

Team Babbage Charles Maingi Seph Newman Jon Rollman Nils Schlupp.

Date post: 03-Jan-2016
Category:
Upload: valentine-greer
View: 220 times
Download: 0 times
Share this document with a friend
12
Team Babbage Charles Maingi Seph Newman Jon Rollman Nils Schlupp
Transcript

Team BabbageCharles MaingiSeph Newman

Jon RollmanNils Schlupp

ACL2 Image Editor

• Text input file provides a list of Bitmap files to edit along with what types of edits to perform.

• Errors are written to a separate file.

TestFile.bmp TestFile_modified.bmp

Storing Bitmaps in ACL2

• Naïve method:– Store RGB values in a single list– Slow access for individual pixels: O(N)

• Possible alternate methods:– Pixel Quadrants:

• Difficult to Implement. Would have to modify AVL tree code.• O(logN)

– Row Tree – Column Trees• Can reuse existing AVL tree code.• O(logN)

Bitmap Data Structure• Solution: A tree of

trees.– Row Tree:

• Key indicates a pixel row.

• Data is another a column tree.

– Column Tree:• Key indicates a

pixel column.• Data is pixel RBG

data.

Key: Pixel Row 2Data: Tree B

Key: Pixel Row 1Data: Other Tree

Key: Pixel Row 3Data: Other Tree

Tree A

Key: Pixel Col 2Data: RGB Data

Key: Pixel Col 1Data: RGB Data

Key: Pixel Col 3Data: RGB Data

Tree B

Program Structure• Main module reads in files (bitmaps and input output text files) with the help of File Reader.• Individual image functions are broken up into their own modules.• These modules will rely on common module with shared functions. Such as converting

between RGB and HSV

Image Manipulation Functions• Colorize/Tint: Adjust RGB values as specified by the user. Accepts whole

numbers as additive and floating numbers as multipliers.– colorize <red adjust> <green adjust> <blue adjust>

• Resize/scale: Resize the file to a new size specified. Accepts size in pixel or percent.– resize <width> <height> [filter]

Original File 200% Scaling With no Filter 200% Scaling With cubic Filter

Example of resize command:

• Crop: Specify a rectangular region to crop out. Specify the upper left and lower right corner.– crop <upper left x> <upper left y> <lower right x> <lower right y>

• Flip: Flips an image either horizontally or vertically. Specify with either h or v.– flip <h/v>

• Rotate: Rotate in increments of 90 degrees. Specify degrees.– rotate <number>

• Trim: Trims the specified color from the edges. Uses top-left pixel if none specified.– trim [red] [green] [blue]

Original File Trimmed based on top-left pixel

Example of trim command:

• Draw: Allows the drawing of a simple shape.– draw line <a x> <a y> <b x> <b y> <width> <color r> <color g> <color b>– draw filled-rectangle <upper left x> <upper left y> <lower right x> <lower

right y> <fill color r> <fill color g> <fill color b>– draw border-rectangle <upper left x> <upper left y> <lower right x> <lower

right y> <border width> <fill color r> <fill color g> <fill color b>– draw filled-circle <center x> <center y> <radius> <fill color r> <fill color g>

<fill color b>– draw border-circle <center x> <center y> <radius> <border width> <fill color

r> <fill color g> <fill color b>

Blank.bmp Blank_modified.bmp

Example of draw commands:

• Decorate: Add a solid color border/frame.– decorate <width> <color r> <color g> <color b>

• Threshold: Remove all pixels below a certain RGB value making them white.– threshold <color r> <color g> <color b>

• Blur: Blur an area (or the entire image) based on nearby pixels.– blur [origin x] [origin y] [radius]

Original File Blurred the Entire Image

Example of blur command:

• Generate- Generates images– solid_color <r> <g> <b>– linear_gradient <x1> <y1> <x2> <y2> <r1> <g1> <b1> <r2> <g2> <b2>– circular_gradient <x> <y> <radius> <r1> <g1> <b1> <r2> <g2> <b2>– checkerboard <width> <height> <r1> <g1> <b1> <r2> <g2> <b2>– Interlacing_horizontal <r1> <g1> <b1> <r2> <g2> <b2> <height>– Interlacing_vertical <r1> <g1> <b1> <r2> <g2> <b2> <width>

• Overlay- Merge a generated image into a given image– overlay #<Generate Image Command># [filter]

+ =

Original BMP File Generated Gradient Gradient overlaid on originalImage using multiply filter.

Example of overlay and linear_gradient commands:

Future Plans• Distortions: Smudges, fisheye, and other effects.• Sharpen: Recover detail from blurred/low resolution

images.• Improve overlay command to take in a second image file to

act as a mask.

+

original.bmp mask.bmp original_modified.bmp

=

Example of plans for improved overlay command:

ProbePSP Summary Plan

LOC/Hour 10 Lines/Hour

Base 0 Lines

Deleted 0 Lines

Modified 0 Lines

Reused 264 Lines

Added 1267 Lines

New 1267 Lines

Total LOC 1531 Lines

Estimated LOC 1267 Lines

Estimated Time 126.7 Hours

• This doesn’t take into account Interfaces, ancillary module components (ex: imports/exports), or include statements.

• Furthermore we have underestimated our total LOC significantly in the past as it is often difficult to determine all the supporting functions ahead of time.

• As such, we are confident we will hit the 2000 LOC mark.


Recommended