TI by OpenAI
TI by OpenAI
TI(SR)
Exercise 1
1.
Digital image: A digital image is a representation of a two-dimensional image in the
form of numerical values, typically rectangular pixels arranged in a grid. Digital
images can be created by scanning an analog image or creating an image directly
with image editing software. They can be stored and transmitted electronically and
can be displayed on a computer or other digital device. Digital images are widely
used in the fields of photography, graphic design, and computer vision and have
many advantages over analog images, such as the ability to easily edit, transmit, and
store them.
Image histogram: An image histogram is a graphical representation of the
distribution of gray levels in the image. It is presented as a bar chart showing the
number of occurrences of each gray level in the image. An image histogram can be
used to evaluate the quality of the image and to optimize its contrast and brightness
by adjusting the distribution of gray levels.
Contour: A contour is a line or area outlining a shape or object in an image. Contours
can be used to define the boundaries of objects in an image, to distinguish between
different parts of an object, or to highlight features of an object.
2.
a. True - Histogram equalization of two differently contrasted identical images will
yield different results.
b. False - There are several color spaces, such as RGB (red, green, blue), CMYK (cyan,
magenta, yellow, black), and HSL (hue, saturation, luminosity).
5. Types of contours:
External contour: outlines the boundary of the object in the image.
Internal contour: outlines the different parts of the object in the image.
Hollow contour: outlines the raised parts of the object in the image.
Raised contour: outlines the hollow parts of the object in the image.
Exercise 2
int main()
{
// Read input image
unsigned char image[IMAGE_HEIGHT][IMAGE_WIDTH];
FILE* fp = fopen("input.raw", "rb");
fread(image, sizeof(unsigned char), IMAGE_WIDTH * IMAGE_HEIGHT, fp);
fclose(fp);
return 0;
}
Exercise 1
(See SR same year)
Exercise 2
b. There are two edges in this image, located at index 2 and index 3. The Robert
filter identifies edges by looking for rapid changes in intensity, which is why it
outputs a large negative value at index 2 and a large positive value at index 3.
c. In practice, edge detectors often detect many other lines in an image that are
not "object edges". This is because edge detectors are sensitive to any rapid
changes in intensity, regardless of whether they are caused by actual object
boundaries or other factors such as noise or texture. Some examples of other
types of lines that may be detected by an edge detector include:
Noise: Random fluctuations in intensity caused by factors such as electronic
noise or variations in lighting can be misinterpreted as edges by an edge
detector.
Texture: Patterns or repeating structures in an image, such as the texture of a
surface or the lines in a checkerboard, can also be detected as edges.
Shadows: Shadows cast by objects in an image can create rapid changes in
intensity that may be interpreted as edges by an edge detector.
Exercise 3