logo Use CA10RAM to get 10%* Discount.
Order Nowlogo
(5/5)

write a program in c using the correct syntax, function, array, file io and variables to produce a simple image processing program.

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Program Summary

You need to write a program in c using the correct syntax, function, array, file io and variables to produce a simple image processing program.

The code should apply the following functions depending on the command line input text

1. Part 1 Perform file i/o

a. -i <FILENAME> specifies the input file to be read in

b. -o <FILENAME> specifies the file name to save the actual image to a file

c. -m display Will display the input file on the screen

2. Part 2 Convert the image to binary image

a. -m binary <LEVELTHRESHOLD> Will convert the input image to a binary image with the level threshold specified by the variable LEVELTHRESHOLD

3. Part 3 Perform edge detection

a. -m edge Will perform edge detection on the image

 

It is expected that you will combine some of the options for example

 

./Program -i InputFIle.run -m display

Will run the program to read in a file and then display it on the screen

 

Marking Criteria

 

The breakdown for 60% is for code functionality, and 40% for code quality is:

Working programme- code example and example of it running 60% - Your code will be examined by multiple automated tests. Make sure you follow the spec sheet carefully! Do not print any extraneous messages which are not required in the spec and print all the necessary messages in exactly the format specified.

The layout of the programme and readability 10% - Following standard formatting conventions such as indentation of loops makes your code easier to read. Do not try to write your entire program on one line. Make sure that any significant pieces of code which are duplicated throughout your program are written as functions to reduce clutter and ease debugging.

Appropriate naming of variables 10% - Using clear and meaningful names for variables helps to make your code self-documenting and easier for you or someone else to understand later.

Good use of comments and good layout 10% - Your code should be well commented, indicating the purpose of the functions. The comment for the "main" function should generally explain what the program does.

Conciseness 10% - The code should be a reasonable and efficient solution to the problem in question.

 

 

 

 

 

 

 

Part 1 – Image reading

In part 1 you should write a program that reads and prints an image, where the input image is run-length encoded.

 

Run-length encoding is a way of coding image data that takes advantage of the fact that large areas of images are homogeneous, i.e. have similar brightness locally.

The image pixels are accessed in \raster-scan" order (ensure you understand raster scan order).

File Format:

The format of the run-length encoded image is:

<width> <height> <grey-levels> <pix1> <len1> <pix2> <len2>

.....

where all the <...>'s represent integer values. White-space (spaces) separate the values.

<width> is the width of the image in pixels. The limit on width is 80 pixels.

<height> is the height of the image in pixels. The limit on height is 100 pixels.

<grey-levels> is the number of grey levels in the image, for instance 2 for a black and white image. The grey-level pixel values can only take the values 0, 1,...,

<grey-levels>-1. The maximum value for <grey-levels> is 4. The limits on

<width>, <height> and <grey-levels> apply to all parts of the assignment.

<pix1> is the grey level pixel value of the first pixel on the first row of the image,

i.e. the top-left pixel.

<len1> is the number of times that the first pixel is repeated, following the image pixels in raster-scan order.

<pix2> is the grey level pixel value of the next pixel, i.e. the first pixel different from <pix1>.

<len2> is the number of times that <pix2> is repeated.

..... the list of <pix>, <len> pairs continuing to the end of the image in the bottom-right hand corner.

The sum of the <len>'s is equal to <width>*<height>. Once you have read the image into your program, print it to standard output (the screen).

The format is as follows:

One character per image pixel. Print a space (' ') for pixel value <grey-levels>-1 (\white"), and a \number" character ('#') for value 0 (\black"). If there are three grey levels, use a dot ('.') for value 1. If there are four grey levels, use a colon (':') for 1 and a dot for 2.

Print a new-line character at the end of every line.

For example, the run-length encoding for the image shown in Figure 1 is 6 5 4 0 2 3 2 0 5 1 2 2 2 3 1 2 4 1 3 0 6 3 2 1 1

This is in the file Practice.run and the image is shown in Practise.img

 

 

(5/5)
Attachments:

Related Questions

. Introgramming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma

. The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

. Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th

. SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

. Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Um e HaniScience

536 Answers

Hire Me
expert
Muhammad Ali HaiderFinance

999 Answers

Hire Me
expert
Husnain SaeedComputer science

893 Answers

Hire Me
expert
Atharva PatilComputer science

532 Answers

Hire Me
June
January
February
March
April
May
June
July
August
September
October
November
December
2025
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
SunMonTueWedThuFriSat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
00:00
00:30
01:00
01:30
02:00
02:30
03:00
03:30
04:00
04:30
05:00
05:30
06:00
06:30
07:00
07:30
08:00
08:30
09:00
09:30
10:00
10:30
11:00
11:30
12:00
12:30
13:00
13:30
14:00
14:30
15:00
15:30
16:00
16:30
17:00
17:30
18:00
18:30
19:00
19:30
20:00
20:30
21:00
21:30
22:00
22:30
23:00
23:30