Ch. 5 Test Flashcards
(72 cards)
Objects can manipulate…
Digitally encoded images and sounds
Objects give programmers…
Access to complex behavior
Until 20 years ago, computers mostly…
Processed numbers and text
Digital image processing includes:
- capturing images with scanners and cameras
- representation and storage of images in efficient file formats
- construction of algorithms used in image-manipulation programs (like photoshop)
(The essential properties of images) When an image is loaded in a program…
The bits map into a rectangle of colored dots (pixels)
(The essential properties of images)
The coordinates of the grid range from:
- (0,0) at the upper right corner to (width-1, height-1) at the lower right corner
- width and height are the dimensions in pixels
- x-coordinates increase positively to the right, y-coordinates increase positively to the bottom.
An image consists of…
A width, height, and a set of pixels
Each pixel is accessible by…
It’s (x,y) coordinates
A pixel contains…
Integer values that represent color in terms of RGB
The pixel at the upper left corner is at…
(0,0)
Image manipulation operations:
Transfer images to and from files and storage in RAM
After loading into RAM, can retrieve or modify a pixel at any grid position
Image manipulation operators allow the program to
Rotate an image
Convert color to gray scale or add filters
Highlight blur or sharpen all or part of an image
Control brightness and perform edge detection
Enlarge or reduce size and apply color inversion
Morph an image into another image
The images package defines classes that allow the programmer to
- load an image from a file
- view the image in a window
- examine and manipulate an image’s pixels
- update the window with changes
- save the image back to a file
APImage and Pixel classes:
The two most important classes in the images package
APImage method includes
Creating an image from a file or a blank image
Returning images height and width
Saving the image
The pixel class…
Represents a pixel -an object of this class contains three integer values to represent the pixels RGB components
Simple image processing program
A program that loads an image from its file and draws it in a window
The first statement of a simple image processing program
Imports the relevant class, APImage, from the images package
The second statement of a simple image processing program
Uses object instantiation to make a new object available to the program and instantiates the class
The third statement of a simple image processing program
Runs the draw method on the object to display it in a window
Java might raise an error if…
There is not enough ram to hold an image
Heap space
The area of ram reserved for Java objects
To prevent a crash…
Adjust the heap space for data memory using the Xmx command-line option
Object based programming uses..
Existing classes objects and methods to solve problems