Sie sind auf Seite 1von 20

1st Assignment

Teknik Pengolahan Citra/Digital Image Processing (TEI 510/S-1)

1. Explain these following file formats :


a. BMP (Windows Bitmap)
A bitmap is an array of bits that specifies the colour of each pixel in a rectangular
array of pixels. The number of bits devoted to an individual pixel determines the
number of colours that can be assigned to that pixel. The BMP file format is
capable of storing two-dimensional digital images both monochrome and colour,
in various colour depths, and optionally with data compression, alpha channels,
and colour profiles. BMP is the native bitmap format of Windows and is used to
store virtually any type of bitmap data.
b. JFIF (JPEG File interchange format)
The JPEG File Interchange Format (JFIF) is an image file format standard. It is a
format for exchanging JPEG encoded files compliant with the JPEG Interchange
Format (JIF) standard. The presence of a JFIF segment implies that:
If the image has three components, its colour format is YCbCr, using a
conversion formula given in the specification. If it has one component, its
colour format is greyscale.
The image has a particular orientation.
If the image is subsampled, it uses a particular subsampling position.
c. EXIF (Exchangeable image file format)
EXIF is a standard that specifies the formats for images, sound, used by digital
cameras, scanners and other systems handling image and sound files recorded by
digital cameras. In a nutshell it allows you to store certain information within your
photos. This information is known as "metadata" and can include things like the
date and time the shot was taken, camera settings like shutter speed and focal
length, and copyright information.
d. JPEG-2000
JPEG 2000 (JP2) is an image compression standard and coding system. The loss
image compression mode of JPEG2000 is based on the "Discrete Wavelet
Transformation" which is supposed to be more efficient compared to the JPEG
algorithm based on "Cosine Transformation".

2. Which one is better for adjustment on your photos using Adobe Photoshop: saving
your photo in DSLR camera as JPEG or TIFF? Explain.
TIFF, because it's perfectly natural for a TIFF file to save image data in colour
space which is used in press. TIFF can also compress image data but uses an
algorithm that doesn't change source data (lossless compression). If you
opened and saved the same TIFF file, you'll end up with exactly the same
image as source. Nothing would change in terms of image data.

3. Execute the following commands and screen captures the results. Explain the result of
each command.
>> pwd

The command pwd show or print the current working directory. It also displays the
current working directory. This command is generally used to identify the current
directory, which in this case is shown in the picture above.

>> ls

ls is a list directory that is used to displays the results of the 'ls' command on
Windows. On Windows, ls returns an m-by-n character array of filenames, where m
is the number of filenames and n is the number of characters in the longest filename
found. Filenames shorter than n characters are padded with space characters.

4. Execute the following commands and explain the result of each command.
>> A = [16 3 2 13; 5 10 11 8; 9 6 7 12; 4 15 14 1]

In the picture shown above, the result is an array of numbers which is called matrix.
By entering the command, MATLAB then displays the 4 x 4 matrix above. Once we
have entered the matrix, it is automatically stored and remembered in the Workspace.
We can refer to it simply as matrix A.

>> size(A)

We use the command size to determine the dimensions of a matrix or vector. In the
picture shown above, it means the matrix has 4 rows and 4 columns.

>>[r,c] = size(A)

The difference between this command and the one before is [r,c] = size(A) for matrix
A, returns the number of rows and columns in A as separate output variables.

>> A(1,1) = 6

The element of row i and column j of the matrix A is denoted by A(i,j). Thus, A(i,j)
in MATLAB refers to the element Aij of matrix A. The first index is the row number
and the second index is the second number. We can correct any entry easily through
indexing. In these command we substitute A(1,1)=16 by A(1,1)=6. The result is as
shown above.
>> A1=A(:,1:3)

The colon operator is used to pick out a certain row or column. Subscript expressions
refer to portions of a matrix. The colon operator can also be used to extract a sub-
matrix from a matrix A. Which in this matrix is shown as A(:,1:3) is a sub-matrix
with the first three columns of A.

>> A2=A(1:3,:)

As a special case, a colon (:) as the row or column specifier covers all entries in that
row or column; thus A(3,:) is the 3rd row of A, and it means A(1:3,:) is a sub-matrix
with the first three rows of A.

>> A1'

The transpose operation is denoted by a single quote ('). It flips a matrix about its
main diagonal and it turns a row vector into a column vector. By using linear algebra
notation, the transpose of m x n real matrix A is the n x m matrix that results from
interchanging the rows and columns of A, which results in A1.
>> A1'+ A2

The matrix A1 which has been transposed into A1 then matrix A2 is added to it. The
matrix A2 is a matrix of the same size as A1, so that each element in the matrix A2
is added to a row in A1.
2nd Assignment
Digital Image Processing (TEI 510/S-1)
Amalina Nur Shabrina, 14/367339/TK/42483

1. The three images shown were blurred using square averaging masks of sizes n = 23, 25, and
45, respectively. The vertical bars on the left lower part of (a) and (c) are blurred, but a clear
separation exists between them. However, the bars have merged in image (b), in spite of the
fact that the mask that produced this image is significantly smaller than the mask that
produced image (c). Explain this.

ANSWER:
The problem happening in question is related to the horizontal separation between bars, so we
can simplify the problem by considering a single scan line through the bars in the image. Let
us consider the scan line as a cross section of a 25 25 mask with a separation of 20 pixels
wide and a vertical bar of 5 pixels wide. The response of the mask is the average of the pixels
that it encompasses. When the mask moves one pixel to the right, it loses one value of the
vertical bar on the left, but it picks up an identical one on the right, so the response doesnt
change. In fact, the number of pixels belonging to the vertical bars and contained within the
mask does not change, regardless of where the mask is located.
The fact that the number of bar pixels under the mask does not change is due to the
particular separation between bars and the width of the lines in relation to the 25-pixel width
of the mask. This constant response is the reason why no white gaps are seen in the image
shown in the Fig (b). Note that this constant response does not happen with the 2323 or the
4545 masks because they are not synchronized with the width of the bars and their
separation.
Amalina Nur Shabrina Digital Image Processing
14/367339/TK/42483 2nd Assignment

2. Image subtraction is used often in industrial application for detecting missing components in
product assembly. The approach is to store a golden image that corresponds to a correct
assembly; this image is then subtracted from incoming images of the same product. Ideally,
the differences would be zero if the new products are assembled correctly. Difference images
for products with missing components would be nonzero in the area where they differ from
the golden image. What conditions do you think have to be met in practice for this method to
work?

ANSWER:
First thing, we have the golden image, and input image acquired during operation. Change
detection via subtraction is basically computing the simple difference between the golden
image and the input image which makes us have a resulting image. This resulting image can
be used in two ways that could be used for change detection. The first is to use pixel-by-pixel
analysis. In the first case we say that the input image is near to the golden image if all the
pixels in the resulting image fall within specified band area. Usually, the same value of
threshold is used for both negative and positive differences, so that we have a band in which
all pixels of the resulting image must fall in order for the input image to be accepted. The
second approach is to simply sum all the pixels in the resulting image and compare the sum
against a threshold.
There are three fundamental factors that need tight control for difference based
inspection to work proper registration which basically addresses the requirement that
comparisons be made between corresponding pixels. Two images can be identical, but if they
are displaced with respect to each other, comparing the differences between them makes no
sense, controlled illumination because changes in illumination can affect the values in a
difference image. One approach used often in conjunction with illumination control is
intensity scaling based on actual conditions, and noise levels that are low enough so that
difference values are not affected appreciably by variations due to noise.

Das könnte Ihnen auch gefallen