EssayGhost Assignment代写,Essay代写,网课代修,Quiz代考

EssayGhost-Essay代写,作业代写,网课代修代上,cs代写代考

一站式网课代修,论文代写

高质量的Assignment代写、Paper代写、Report代写服务

EG1hao
网课代修代上,cs代写代考
C语言代写
您的位置: 主页 > 编程案例 > C语言代写 >
代写C语言:算法作业代写 Computer Algorithms and Architecture - C语言代写
发布时间:2021-07-25 19:39:45浏览次数:
EEE2048: Computer Algorithms and Architecture 2018/19 ProgrammingAssignmentQuadtree Encoding of a BinaryImageDeadline for Submission to SurreyLearn: 4:00pm, Tuesday 4th December 2018IntroductionSilhouettes contain much of the shape information necessary to recognise simple objects. For this reason they have been used widely in machine vision systems that check the shape of industrial parts or provide grasping information to robots. The digital version of a silhouette is a binary imagei.e. an array of 1 s and 0 s. Figure 1 shows a digital image. In a binary image version of this, 0 represents a dark area and 1 represents a light area. The positions of pixels are defined with respect to the coordinate system shown in the figure.A significant problem of image processing is the large amount of storage needed for image data and the consequent computational load of performing calculations on large numbers of pixels. There has therefore been much effort in developing data representations or codings which are more compact but still capture the relevant features of the data. One promising data structure is the quadtree. The quadtree encoding of the binary image shown in Figure 1 is given in Figure 2.算法作业代写Figure 1: Binary image arrayFigure 2: Quadtree corresponding to binary image arrayQuadtrees are created from images whose sizes are integer powers of 2. Each node of the quadtree corresponds to a square area in the binary image. The node at level 0 of the tree corresponds to the whole image area. Child nodes correspond to the areas given by dividing the image into 4 non-overlapping quadrants. The quadrants are denoted NW (north-west), NE (north- east), SE (south-east) and SW (south-west) respectively, as shown in the inset part of Figure 1. Nodes at lower levels of the tree again correspond to splitting of parent areas into smaller quadrants. Each node is labelled to indicate the type of pixels contained within its area. Three labels are distinguished: W for white (all pixels in area are of value 1), B for black (all pixels in area are of value 0) and G for grey (area contains both pixels of value 1 and pixels of value 0). Splitting of areas into sub-quadrants terminates when nodes contain only one type of pixel i.e. when nodes are labelled B or W. The resultant data structure generally contains far fewer nodes than the number of pixels in the original image. Nodes near the root of the tree correspond to large blocks  of the image and if the binary image contains objects which are large and convex then they will be represented naturally by few nodes.Programming TaskThe programming assignment consists of writing procedures which will1. Read a square binary image from a text file into an array structure,2. Generate a pointer based quadtree from the binary image,3. Traverse through the pointer based quadtree and print out for each black terminal node the position of the top left of the quadrant and its size.The program must read the image data from a text file which contains coded information on the size of the image and the number and position of black pixels in the image. The image file containsintegers and the file has the following format: image width in pixelsnumber of black pixelsx y location of each black pixelFor the example of the image in Figure 1, the file would contain the data shown in Figure 3. You can assume that the image size will never exceed 64 columns by 64 rows.8154 15 12 23 24 25 22 33 34 35 34 45 46 44 55 5Use an integer array as an intermediate data structure to help in generating the pointer based quadtree. Producing the pointer based quadtree involves taking the array and generating a node  to represent it. The array can then be tested for colour uniformity. If it is not of a uniform colour  then the array must be divided into four quadrants and nodes created for these. Each quadrant must then be tested and the same process recursively performed until all terminal nodes of the tree represent uniformly coloured areas. Internally your program should represent each node of the quadtree as a struct datatype containing 9 fields. The first five pieces of information are pointers to the parent, P, and four children of the node (NW, NE, SE, SW), the next piece of information is the colour of the node (i.e. B, W or G), and the final three pieces of information are the size and the location of the block of pixels that the node represents (the location is represented by the coordinates of the top left pixel of that block).Input parametersYour program should read data from a file with path specified using a command line parameter. This parameters should be the only parameter expected by the program, and should be required to be specified immediately after the executable name at run-time e.g. quadtree my_image.txtThe input file will contain the image data in a format as illustrated in Figure 3 and in the example file input.txt provided on SurreyLearn.Output dataYour program should print out on the screen the list of all terminal black nodes. The output should indicate for each black terminal node the position of the top left of the quadrant and its size. For example, the output of processing the example file input.txt provided on SurreyLearn is shown in Figure 4. It should be noted that there is no specific requirement in terms of the order in which the black terminal nodes are printed out. Therefore any output where the lines shown in Figure 4 are permuted would be equally valid.Black terminal node at position (2,2) with size 2 Black terminal node at position (4,1) with size 1 Black terminal node at position (5,1) with size 1 Black terminal node at position (4,2) with size 2 Black terminal node at position (4,4) with size 2 Black terminal node at position (6,4) with size 1Figure 4: Example screen output when processing input file shown in Figure 3Coding standardsAll programs should be clearly structured with good indentation to indicate the structure. Aim to make all code largely self-documenting. Comments should indicate the purpose and means of implementation of each program section. Procedures should be kept self-contained with well- defined interfaces to other procedures. Each procedure should contain a commented header explaining:· The purpose of the procedure or function,· The description of all input and output parameters.DeliverablesWhen trying to solve a problem using a computer, the major effort should be directed at the design of the algorithm and choice of the best data structures. Actual coding is only a small part of the exercise. The deliverables for the project will be:1) A short writtenreportThe report should include:· The design of the program. It should define what the program and its functions do and what assumptions or restrictions are made on its use. It should include a description of the purpose and functionality of each function. It should give a brief structural description of the program with a simple top-down structured diagram which indicates the inter-relationship of functions (calling hierarchy). It should also describe to a naïve user how to run the program.· A section presenting example results of the run of the program. This should demonstrate the correct operation of the program on a range of input images.The report should not exceed 4 pages in length (excluding the cover page and table of contents). Any pages beyond 4 will be ignored for assessment purposes. The report should be submitted to SurreyLearn in pdf format.2) C source codeprogramsThese should be submitted to SurreyLearn. Submitted files should include quadtree.c and any necessary header files included from the C code that are not standard C header files.The code must be capable of being compiled using the Linux machines in the Otter lab. If students develop code elsewhere then they will need to ensure it meets this requirement prior to submitting it.Assessment CriteriaCriteria for the assessment of the coursework are: clarity of program description, inclusion of suitable results, appropriate analysis of results, and presentation.Assessment of the code will involve a mix of automated test procedures and human assessment. Checking will test for compilation warnings and errors, run-time errors and correctness of information. Human assessment will consider structure, design and clarity of the solution. Aspects which the human marker will pay attention to include: modularity of solution, internal re-use of code, good commenting of code, sensible and clear layout, avoidance of global declarations, appropriate use of data-types, good error checking, easily understandable output and efficiency of implementation. You should aim to make the code easy to use and modify. Accuracy of output will be checked manually, therefore you need not worry about formatting the output to exactly match the example provided above (for example, white space or carriage return characters), as long as your program clearly returns the expected information.You must work individually and independently to develop the code and produce the report. Source code will be compared using TurnItIn to check that it is original code and has not been written in collaboration with other students.Marking Scheme

所有的编程代写范围:essayghost为美国、加拿大、英国、澳洲的留学生提供C语言代写、代写C语言、C语言代做、代做C语言、数据库代写、代写数据库、数据库代做、代做数据库、Web作业代写、代写Web作业、Web作业代做、代做Web作业、Java代写、代写Java、Java代做、代做Java、Python代写、代写Python、Python代做、代做Python、C/C++代写、代写C/C++、C/C++代做、代做C/C++、数据结构代写、代写数据结构、数据结构代做、代做数据结构等留学生编程作业代写服务。