While the coding should be primarily your sole work, any help you

Published by

Sep 28, 2022

s

Struggling with a similar assignment? Don’t know where to start? Don’t have time to work on this? Get a high-quality paper written for you from scratch – PLAGIARISM FREE, guaranteed to get you a good grade. To get started, please click on the Submit Your Instructions at the bottom of the page.

 
PROGRAM DESCRIPTION: In this assignment, you will be processing user submitted images in C++. Specifically, you will be labelling and counting the number of objects in a given image. Each image consists of a number of pixels, and initially all pixels will have one of two labels, 0 and1. 0 is considered a background pixel while a 1 represents a pixel that is part of an object. Your system will apply, over two iterations, the same label to pixels that are connected to form objects, and then count the number of objects for a given image.
CSCE 1030: Homework Assignment  PROGRAM DESCRIPTION: In this assignment, you will be processing user submitted images in C++. Specifically, you will be labelling and counting the number of objects in a given image. Each image consists of a number of pixels, and initially all pixels will have one of two labels, 0 and 1. 0 is considered a background pixel while a 1 represents a pixel that is part of an object. Your system will apply, over two iterations, the same label to pixels that are connected to form objects, and then count the number of objects for a given image. Additionally, sample input files will be found on the CSE machines at home/jeh0289/public/csce1030/sp19/hw4 You can cd into that directory and copy the input files from there. Every line will contain the comma delimited list of 0/1 pixel labels. Example Input Image .Label 0 indicates a background pixel 11 0 1 01 0 1 11 110 00 1 Label 1 indicates a pixel that is part of an object ? ()Oly (24xmsickx visels which hares: label 1 1 0 0 1 0 0 0 0 10 1 First Pass (d) Pixel1,8) has no pixel above of left (b) Start from top left with new labelPie1,4] has no pixel above of left Create a new label 2 Create a new label 3 e) Pixell3,4) has both above and left label. Choose the smallest label Store larger label as a child of smallest (f) Completing row 7, new label 6 B) First pass complete Second Pass (c) The Final result (a) Label after First Pass (b) Converting a ‘2’ into a ‘1’ Start again from top left with new label: .checks the data structure for the label ‘1’ ‘1’ is not a child of any other labels For pixel (1,4),checks the data structure for ‘2 It notices that ‘2’ is a child of ‘1 . Then, it checks for ‘1’ (root) It replaces the label of (1, 4) with ‘1’ PROGRAM REQUIREMIENTS You must organize your program into three files: * euidHW4func.h This file will contain the include directives for the necessary libraries, any type definitions, any structure definitions, and the list of function prototypes (i.e. function euidHW4main.cpp This file will contain the local include directive for the header file as well as * the main function for the program. *euidHW4func.cpp This file will contain the local include directive for the header file as well as all function definitions (except the main) used in the program. *Be sure to replace euid with your EUID Be sure to submit all three files when submitting your assignment. As with all homework programs in this course, your program’s output will initially display the department and course number, your name, your EUID, and your email address. This output should be performed through a function you declare and define. Define a structure (i.e. struct) to represent a relationship between two integer labels. It should store two integer labels, and a pointer to another relationship structure of the same type * . * You will need to declare and define a function to process the user specified file by Prompting the user for a file name. If the file does not exist, let the user know this and reprompt until a correct file name is submitted. .Reading from the file and comectly storing the 0’s and 1’s into the dynamic 2-dimensional array You will need to declare and define a function that takes in a dynamic, 2-dimensional array and its size, and outputs the int value of every slot in a grid format. You will need to declare and define a function to perform the first pass processing of the image stored in the dynamic, 2-dimensional aray. The function should examine each pixel and process it in the following way. . . If the current pixel is a 0, the it is a background pixel and should be ignored If the current pixel is a 1, the label of the pixels above and to the left of the current pixel should be checked There will be three possible cases . Case 1: If the top and left pixels are background pixels or do not exist, create a new, non zero, positive integer, unique label and assign it to the current pixel.] ” Case 2: If one of the top or left pixels is a background pixel or does not exist, and the other has a label, the current pixel will be assigned the same label as the labeled pixel. Case 3: If both the top and left pixels have different labels, assign the current pixel the smallest label and store that there is a relationship between the two labels in a relationship structure. Be sure to connect the new structure at the end of the chain of structures, as this will be used in the second pass. See the First Pass example, and note the 2 ->1 style relations on the right side of the grid. ” ” You will need to declare and define a function to perform the second pass processing of the image stored in the dynamic, 2-dimensional array. The function should examine each pixel and process it in the following way. . If the current pixel is a 0, then it is a background pixel and should be ignored Otherwise, the pixel’s label should be checked against the chain of relationships, and if a relationship exists between its label and another label, the smaller label should replace the current one. The chain may need to be checked multiple times to ensure the smallest label is applied to a pixel. *See the Second Pass example. You will need to declare and define a function to count and output the current number of unique labels in the dynamic, 2-dimensional array Inside your main function you will need to . . Declare and dynamically allocate the correct amount of space for an 8×8, two-dimensional, dynamic array of integers representing the image to be processed. Declare a relationship structure pointer to maintain the chain of discovered relationships. Process the input file using the appropriate function and store the data in the dynamic aray. Because the dimensions of the image cannot be stored globally, be sure you store them for later function calls. Output the current state of the two-dimensional, dynamic array using the appropriate function. *Perform the first pass processing on the two-dimensional, dynamic aray using the appropriate function Output the updated state of the two-dimensional, dynamic array using the appropriate functioin. Output the current number of labels objects in the two-dimensional, dynamic array using the appropriate function. *Perform the second pass processing on the two-dimensional, dynamic array using the appropriate function and the chain of relationships. Output the final state of the two-dimensional, dynamic array using the appropriate function. Output the final number of labels objects in the two-dimensional, dynamic aray using the appropriate function. You should not to create or use any globally defined variables, though your struct should be globally defined. * . Your code should be well documented in terms of comments. For example, good comments in general consist of a header (with your name, course section, date, and brief description), comments for each variable, and commented blocks of code. This means, that in addition to the program printing your information to the terminal, it will also appear in the code in the comments as well. * Your program will be graded based largely on whether it works correctly on the CSE machines (eg.. cse01, cse02, …, cse06), so you should make sure that your program compiles and runs on a CSE machine. This programming assignment is designed to help you practice your coding on a larger project with various pieces of functionality. While the coding should be primarily your sole work, any help you I SAMPLE OUTPUT: Here is a sample output to help you write and test your code. The item in bold is the information entered by the usei $ ./a.out Computer Science and Engineering CSCE 1030 – Computer Science I Student Name EUID euid@my.unt.edu I Please enter the name of the file: imagel.txt Original image: 010 0001 0 0 10 1101 0 0 10 1101 0 010 0001 0 First pass image: 010 0001 0 0 1022 01 0 0 1022 01 0 010 0001 0 Image contains 2 objects. Second pass image: 010 0001 0 0 1022 01 0 0 1022 01 0 010 0001 0 Image contains 2 objects I $ ./a.out Computer Science and Engineering CSCE 1030 – Computer Science I Student Name EUID euid@my.unt.edu I Please enter the name of the file: imagew.txt imagew.txt does not exist. Please try again image2.txt Original image: 1 01 11011 1 11 0111 0 1 10 00 0 0 1 010 00 0 0 1 1 10 00 0 0 1 1 00 00 0 0 1 First pass image: 1 0 2 2 2 03 3 1 11 0 2 2 2 0 4 40 0 0005 0 40 00 0 0 5 6 40 00 0 0 5 6 00 00 0 0 5 Image contains 7 objects. Second pass image: 1 01 11011 1 11 0111 0 4 40 00 0 0 5 0 40 00 0 0 5 4 40 00 0 0 5 4 00 00 0 0 5 4 40 5 5 5 5 5 Image contains 3 objects. TESTING Test your program to check that it operates as desired with a variety of inputs. Then, compare the answers your code gives with the ones you get from hand calculations. Show transcribed image text CSCE 1030: Homework Assignment 4 Due: 11:59 PM on Sunday, April 28, 2019 PROGRAM DESCRIPTION: In this assignment, you will be processing user submitted images in C++. Specifically, you will be labelling and counting the number of objects in a given image. Each image consists of a number of pixels, and initially all pixels will have one of two labels, 0 and 1. 0 is considered a background pixel while a 1 represents a pixel that is part of an object. Your system will apply, over two iterations, the same label to pixels that are connected to form objects, and then count the number of objects for a given image. Additionally, sample input files will be found on the CSE machines at home/jeh0289/public/csce1030/sp19/hw4 You can cd into that directory and copy the input files from there. Every line will contain the comma delimited list of 0/1 pixel labels. Example Input Image .Label 0 indicates a background pixel 11 0 1 01 0 1 11 110 00 1 Label 1 indicates a pixel that is part of an object ? ()Oly (24xmsickx visels which hares: label 1 1 0 0 1 0 0 0 0 10 1 First Pass (d) Pixel1,8) has no pixel above of left (b) Start from top left with new labelPie1,4] has no pixel above of left Create a new label 2 Create a new label 3 e) Pixell3,4) has both above and left label. Choose the smallest label Store larger label as a child of smallest (f) Completing row 7, new label 6 B) First pass complete
Second Pass (c) The Final result (a) Label after First Pass (b) Converting a ‘2’ into a ‘1’ Start again from top left with new label: .checks the data structure for the label ‘1’ ‘1’ is not a child of any other labels For pixel (1,4),checks the data structure for ‘2 It notices that ‘2’ is a child of ‘1 . Then, it checks for ‘1’ (root) It replaces the label of (1, 4) with ‘1’ PROGRAM REQUIREMIENTS You must organize your program into three files: * euidHW4func.h This file will contain the include directives for the necessary libraries, any type definitions, any structure definitions, and the list of function prototypes (i.e. function euidHW4main.cpp This file will contain the local include directive for the header file as well as * the main function for the program. *euidHW4func.cpp This file will contain the local include directive for the header file as well as all function definitions (except the main) used in the program. *Be sure to replace euid with your EUID Be sure to submit all three files when submitting your assignment. As with all homework programs in this course, your program’s output will initially display the department and course number, your name, your EUID, and your email address. This output should be performed through a function you declare and define. Define a structure (i.e. struct) to represent a relationship between two integer labels. It should store two integer labels, and a pointer to another relationship structure of the same type * . * You will need to declare and define a function to process the user specified file by Prompting the user for a file name. If the file does not exist, let the user know this and reprompt until a correct file name is submitted. .Reading from the file and comectly storing the 0’s and 1’s into the dynamic 2-dimensional array You will need to declare and define a function that takes in a dynamic, 2-dimensional array and its size, and outputs the int value of every slot in a grid format. You will need to declare and define a function to perform the first pass processing of the image stored in the dynamic, 2-dimensional aray. The function should examine each pixel and process it in the following way. . . If the current pixel is a 0, the it is a background pixel and should be ignored
If the current pixel is a 1, the label of the pixels above and to the left of the current pixel should be checked There will be three possible cases . Case 1: If the top and left pixels are background pixels or do not exist, create a new, non zero, positive integer, unique label and assign it to the current pixel.] ” Case 2: If one of the top or left pixels is a background pixel or does not exist, and the other has a label, the current pixel will be assigned the same label as the labeled pixel. Case 3: If both the top and left pixels have different labels, assign the current pixel the smallest label and store that there is a relationship between the two labels in a relationship structure. Be sure to connect the new structure at the end of the chain of structures, as this will be used in the second pass. See the First Pass example, and note the 2 ->1 style relations on the right side of the grid. ” ” You will need to declare and define a function to perform the second pass processing of the image stored in the dynamic, 2-dimensional array. The function should examine each pixel and process it in the following way. . If the current pixel is a 0, then it is a background pixel and should be ignored Otherwise, the pixel’s label should be checked against the chain of relationships, and if a relationship exists between its label and another label, the smaller label should replace the current one. The chain may need to be checked multiple times to ensure the smallest label is applied to a pixel. *See the Second Pass example. You will need to declare and define a function to count and output the current number of unique labels in the dynamic, 2-dimensional array Inside your main function you will need to . . Declare and dynamically allocate the correct amount of space for an 8×8, two-dimensional, dynamic array of integers representing the image to be processed. Declare a relationship structure pointer to maintain the chain of discovered relationships. Process the input file using the appropriate function and store the data in the dynamic aray. Because the dimensions of the image cannot be stored globally, be sure you store them for later function calls. Output the current state of the two-dimensional, dynamic array using the appropriate function. *Perform the first pass processing on the two-dimensional, dynamic aray using the appropriate function Output the updated state of the two-dimensional, dynamic array using the appropriate functioin. Output the current number of labels objects in the two-dimensional, dynamic array using the appropriate function. *Perform the second pass processing on the two-dimensional, dynamic array using the appropriate function and the chain of relationships. Output the final state of the two-dimensional, dynamic array using the appropriate function. Output the final number of labels objects in the two-dimensional, dynamic aray using the appropriate function. You should not to create or use any globally defined variables, though your struct should be globally defined. * . Your code should be well documented in terms of comments. For example, good comments in general consist of a header (with your name, course section, date, and brief description), comments for each variable, and commented blocks of code. This means, that in addition to the program printing your information to the terminal, it will also appear in the code in the comments as well. * Your program will be graded based largely on whether it works correctly on the CSE machines (eg.. cse01, cse02, …, cse06), so you should make sure that your program compiles and runs on a CSE machine. This programming assignment is designed to help you practice your coding on a larger project with various pieces of functionality. While the coding should be primarily your sole work, any help you
I SAMPLE OUTPUT: Here is a sample output to help you write and test your code. The item in bold is the information entered by the usei $ ./a.out Computer Science and Engineering CSCE 1030 – Computer Science I Student Name EUID euid@my.unt.edu I Please enter the name of the file: imagel.txt Original image: 010 0001 0 0 10 1101 0 0 10 1101 0 010 0001 0 First pass image: 010 0001 0 0 1022 01 0 0 1022 01 0 010 0001 0 Image contains 2 objects. Second pass image: 010 0001 0 0 1022 01 0 0 1022 01 0 010 0001 0 Image contains 2 objects
I $ ./a.out Computer Science and Engineering CSCE 1030 – Computer Science I Student Name EUID euid@my.unt.edu I Please enter the name of the file: imagew.txt imagew.txt does not exist. Please try again image2.txt Original image: 1 01 11011 1 11 0111 0 1 10 00 0 0 1 010 00 0 0 1 1 10 00 0 0 1 1 00 00 0 0 1 First pass image: 1 0 2 2 2 03 3 1 11 0 2 2 2 0 4 40 0 0005 0 40 00 0 0 5 6 40 00 0 0 5 6 00 00 0 0 5 Image contains 7 objects. Second pass image: 1 01 11011 1 11 0111 0 4 40 00 0 0 5 0 40 00 0 0 5 4 40 00 0 0 5 4 00 00 0 0 5 4 40 5 5 5 5 5 Image contains 3 objects. TESTING Test your program to check that it operates as desired with a variety of inputs. Then, compare the answers your code gives with the ones you get from hand calculations.
 

n

Need Writing Help? Our writing specialists are here 24/7, every day of the year, ready to support you! Instantly chat with an online tutor below or click here to submit your paper instructions to the writing team.

More than just an assignment.

GET THE GRADES YOU DESERVE | A OR A- GUARANTEED
NO MORE SLEEPLESS NIGHTS DOING RESEARCH
NO MORE LATE POINTS DEDUCTIONS 
GET A QUALITY PAPER SENT TO YOUR EMAIL
GET GOOD GRADES ON YOUR ASSIGNMENTS
Explore Now →

Who is this homework service for?

* If you are having a really hard class and want to get through it, then this is for you.

* If you have a medical emergency or someone close to you has a medical emergency and you don’t think you’ll be able to turn your assignment on time, this is definitely a service you could use.

* You can use us if you are having a tough Professor who won’t give you the grades you deserve.

* If you have a tight work schedule and you are getting points deducted for not submitting assignments on time.

* English might not be your first language and you feel like you are being left behind in class because of it.

* If you have a large project coming up and don’t think you have enough time to get it done well, definitely reach out to us.

TALK TO SUPPORT
{

Super stoked you are checking us out! We would like to help you with your assignment. We just need a few things from you:

* The full assignment instructions as they appear on your school account.

* If a Rubric is present, make sure to attach it.

* Any relevant weekly readings or learning resources.

* Include any special announcements or emails you might have gotten from your Professor regarding your assignment.

* Any templates or additional files required to complete the assignment.

If your assignment is somewhat complex and you need to explain it, please don’t hesitate to reach out to me via live chat. 

 

FAQ

Frequently asked questions

How soon can I get my paper done?

It depends with your deadline. If you need your paper completed in 3 hours, we will deliver it in that time. All you need to do is indicate your deadline in our custom order page here. Alternatively, if you are sending us your instructions via email, please be sure to indicate your deadline.

Will it be completely original? I don't want to be caught in a case of Academic Integrity Violation.

We are as paranoid as you are. Maybe even more! And we understand that the greatest sin you can commit in your academic journey is plagiarizing your academic work. To that end, we have made sure that we check and double-check our papers using high quality plagiarism detection tools such as SafeAssign and Turnitin before submitting the paper to you.

Who is my writer? Is he/she a native English Speaker?

All our writers are native English Speakers. That is not to say that ESL writers are not good, we just prefer hiring native writers because we want the very best people working on your paper. This might mean paying a little bit more for your paper as opposed to when you pay a foreign company whose writers are non-native English Speakers.

What if I need revisions? Will your charge additional for this?

Of course not! If you do happen to require a revision on your paper, our team will handle it for you free of charge. Matter of fact, we won’t rest till you are happy with your paper. So, ask for as many revisions as you need, it’s completely FREE!

Will you give me my money back if I don't like my paper?

We have very few instances where we delivered a paper that a client didn’t fall in love with. But if it so happens that you don’t like your paper for any reason whatsoever, we’ll refund your money back no questions asked.

I have more assignments after this, can you help me with those too?

Of course! And what’s even better is that we can reserve a writer permanently to work on your entire class. This comes in handy for projects which build up on each other and where you need just one writer, one writing style.

I got my order information wrong, can I change that?

Yes you can. Just reach out to our support team via email (support@essaynook.com) or live chat here and they’ll help you change the instructions.

Can I place an order via email instead of going through the order page?

Yes you can. Email Anna at anna@essaynook.com, she’s in charge of our sales team. Alternatively, you can talk to our Live Chat team here and request to speak to Anna.

Trusted by Thousands of Students

Delivering quality assignments since 2007

%d bloggers like this: