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

637 Answers

Hire Me
expert
Muhammad Ali HaiderFinance

890 Answers

Hire Me
expert
Husnain SaeedComputer science

735 Answers

Hire Me
expert
Atharva PatilComputer science

651 Answers

Hire Me

Get Free Quote!

347 Experts Online