Question

The ACME Manufacturing Company has hired you to help automate their production assembly line. Cameras have...

The ACME Manufacturing Company has hired you to help automate their production assembly line. Cameras have been placed above a conveyer belt to enables parts on the belt to be photographed and analyzed. You are to augment the system that has been put in place by writing C code to detect the number of parts on the belt, and the positions of each object. The process by which you will do this is called Connected Component Labeling (CCL). These positions will be passed to another system, which will use the coordinates provided to pick up and move the parts. Figure 1 shows the typical output from the existing camera system. The camera manages to replace all the pixels associated with the conveyer belt with green pixels.

Figure 1. Image from camera showing two objects on conveyer belt

Required System Behavior:

Download the zip file containing the executable, Project_1.exe, from the Black Board course website, under the Project 1 folder, and run it. Your program should reproduce all the functionality given in the Project_1.exe (except for the extra credit). I’ve provided a Visual Studio Solution that already includes all the needed libraries. Use this solution to code your project.

When your program runs, it should present the following menu:

Make sure you implement input validation for the menu. The menu will not repeat after a valid selection is made. Use the following symbolic constants to test the choices entered by the user:

• mnuQuit
• mnuShowColorImg
• mnuShowGrayImg
• mnuShowThresholdImg • mnuIdObject

The Display Library:

In order for you to create graphics within C++, a library called display.c (with associated display.h) has been provided for you on Black Board. This library uses OpenGL (Open Graphics Library) to render graphics to the screen. The display.c library allows you to “paint” a picture by setting pixels in a grid to various values. The color of a pixel at any given row and column location is determined by the amount of red, green, and blue light intensities at that point. For example, to get a white pixel to show up at the position 112, and 90 for the row and column respectively you would call the function below with row set to 112, col set to 90, red set to 1, green set to 1, and blue set to 1.

UpdatePixel(int row, int col, float red, float green, float blue)

Each color channel has a minimum value of 0 and a maximum value of 1. So to get a red pixel, you would set the RGB (Red, Green, Blue) color channels to 1,0,0 respectively. After you have set all the pixel values as needed (any unset pixels are black by default), you can show the resulting image by calling the ShowDisplay function:

ShowDisplay()

Once you call this function, program execution control moves to the Display.c library and your code will seize to respond, so this should be the last function called in your code.

In the display.h file there are two symbolic constants, IMG_WIDTH and IMG_HEIGHT. Use these constants to know the maximum width and height of the display (you cannot write beyond these limits). The “row” and “col” in the UpdatePixel function starts from 0 and ends at IMG_WIDTH-1 or IMG_HEIGHT-1. Start out by testing the display function. Simply use a nested for loop to write to each pixel and set the color of each pixel to something other than black (0,0,0). You should get something like the figure below:

Figure 2. Testing display.c library

Acquiring Image Data

The existing camera system mounted above an assembly line allows you to acquire a single frame of video. When this is done, it produces three files (objects1_red.csv, objects2_green.csv, objects3_green.csv). Each of these files contains pixel information for each color channel. Download the files provided on Black Board and place in your project directory (where your .c file is located). Open one of the files in Notepad or in Excel and you should see lots of numbers separated by comas. Each number represents a color intensity level from 0 to 255 at every row and column position of the image. The number of rows and columns match the IMG_WIDTH (columns) and IMG_HEIGHT (rows) symbolic constants.

Write a routine to open each of the three input files and read each color intensity value. Remember to validate that the files are successfully open before proceeding (display an error message otherwise). Also, keep in mind that each line in the input files represents a row of pixel values (for a particular color). Which means you should have IMG_WIDTH number of values for each line of data, and you should have IMG_HEIGHT number of lines.

It is advised that all of the routines for the 4 menu choices should be driven through the image acquisition loop (the loop you write to read the pixel values from the files)

Showing Acquired Image in Color

As you read each pixel RGB value, keep track of the row and column you are in. Use this information to call the UpdatePixel function to display the color image being read. You should note that in OpenGL, the y axis is inverted (upside down), which means you need to invert your image data as well in order for it to appear right side up (as in figure 1). Also, keep in mind that the UpdatePixel function takes values between 0 and 1 for each color channel, not 0 and 255. Lastly, once you set the pixels and show the

image, you may notice that it looks blockier than the original. This is due to the way pixels are represented in the OpenGL library (in this case, they have been doubled).

Showing Acquired Image in Grayscale

The process of converting the color image to grayscale is simply to average the red, green and blue channels. This is a typical step in computer vision, because it makes it easier to run algorithms designed to work on light intensity as opposed to color. Figure 3 shows the output of the grayscale routine.

Figure 3. Output of the grayscale routine

Showing the Thresholded Image

Thresholding is the process of set the pixel values in the image to either black or white (0 or 1) based on their current values. It greatly simplifies the information contained within an image. You will threshold the image provided by noting that the conveyer belt (the background of the image) has been replaced with green(ish) pixels by the camera system. The actually RGB value of these pixels are 39, 196, and 18. Because we have these precise values, we can operate directly on the color image to threshold, as opposed to working with the intensity values from the grayscale image. Set all pixels with that RGB combination to 0 and all other pixels to 1. The result should be as shown in figure 4.

Figure 4. Output of the threshold routine

Identify Locations of Objects

In order to identify the locations of the objects in the threshold image, you need to apply the principle of connected component labeling. Basically, you are trying to determine all the pixels that are clumped together (touching each other), and then label those pixels as object 1 and object 2. Write a function called DetectShapes to perform this task:

DetectShapes(int pixel, int row, int col)

Each time a new pixel value is read, call this function to process that data. You will need to define global variables to keep track of the state of the function (local variables will loose their values once the function exits). The general process you should follow is:

Set a variable, ‘inShape’ to true when the current position is in a shape and false when it is out of the shape (keep in mind that there are small artifacts around the circular shape so you should implement a way of dealing with this so the code doesn’t register the artifact as a shape on its own)

Step 1 only handles knowledge of the shape one row at a time, set a variable ‘foundShape’ to true when a shape has been found across multiple rows, and false when a whole row has passed without a shape

Set variables to store the starting row/col position of the shape, and ending row/col position of the shape. These four variables should give and upper left and rower right corner of a bounding box that contains the shape. Display these coordinates to the screen

Use the bounding box calculated in step 3 to determine the centroid (center of the shape).

Using the coordinates for the bounding box, and the centroid to display a box around each object,

and a filled box at the center of mass (centroid) of each shape.

The output of the Identify Locations routine is shown in figure 5.

Figure 5. Output of the Identify Location routine

Things to Consider:

Your goal should be to faithfully replicate this program as closely as possible. Also, pay attention to the following:

For the menu to select the desired routine, if the user enters an invalid menu selection, the program displays an error and redisplays the menu until a valid selection is entered.

Your program should display an appropriate error message if any of the three input files can not be read

The coordinate axes is inverted for the OpenGL display

Once the ShowDisplay function is called, your program essentially freezes, you simply close the

window to stop execution.

Grading

Grading is assigned as follows:

Good general programming style => 10 points

Display color image => 10

Display gray scale image => 20

Display threshold image => 20

Display number of identified objects and locations => 40

Display bounding box and centroid on image => Extra Quiz Credit (25)

Points will be assessed based on how closely your work matches what is expected in each area.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Acme Network Design

Acme Manufacturing requested a comprehensive plan for implementing VLANtechnology and wireless connectivity to there multiple company locations in an effort to improvenetwork performance for its executive office suite and the various company departments. The proposal will cover recommendations for the overall network design to address their expandingoperations with the acquisition of a plant in China as well as several other offices throughout theUnited States. The report will also cover network topology, the hardware and software needed tocomplete the project while segmenting the network for network efficiency and enacting security policies and procedures to ensure data integrityThe Virtual Local Area Network (VLAN) will connect six different geographicallocations: New York, Chicago, Atlanta, Phoenix and China. For four different purposes:Management, Sales, Creation and Manufacturing. With weekly telecommutes withrepresentatives from each office. Provide lifecycle recommendations for the management of theWAN.ScopeThe following network design for Acme Manufacturing includes the recommendedtechnologies to provide data, voice and video connectivity between remote offices. The scope of the design includes recommended WAN technologies, network services, network components,logical topology, security and finally lifecycle recommendations.RequirementsThe Acme Manufacturing WAN requires connectivity to six different offices located infive different cities around the world. The WAN must support basic data traffic between servicesrecommendations such as voice and video must be included within the network design.The network design must support an estimated 1000 network users between all officesand be flexible for future growth in network users and locations. As of today, the approximatenumber of users by location is as follows: Atlanta, Georgia Headquarters: 300 network users,Atlanta, Georgia Engineering: 300 network users, Distribution Facilities: 300 network userscombined, China: 100 network users combined. Network OverviewThe logical arrangement is to create a VLAN segmented according to the differentdepartments. Each segment can have its own group permissions and privileges. Multilayer switches, client devices, servers and wireless routers will drive the recommended network design. Routers placed on the backbones, between floors and between LAN and frame relaynetwork provider. Recommended also is application and storage servers for each department, onee-mail and one VIP server for each location.The physical media that connects the locations to the public switched network for domestic operations is a leased fiber optic line and for China a satellite connection. Componentsfor the network system require switches, servers, client systems and wireless routers.Components required for video conferencing: Videoconferencing Codec Unit, Camera,Microphones, Video Displays and Conference Room Lighting of diffused directional lightingand integrated into the construction of the building.

Add a comment
Know the answer?
Add Answer to:
The ACME Manufacturing Company has hired you to help automate their production assembly line. Cameras have...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Problem1: BMPmain.c, BMPfns.c, BMPfns.h, Makefile The file 'BMPmain.c' contains a main() function which is already written...

    Problem1: BMPmain.c, BMPfns.c, BMPfns.h, Makefile The file 'BMPmain.c' contains a main() function which is already written for you and attached with this homework. When appropriate functions are provided, main() will create a .bmp image file. Your job is to write 'BMPfns.c' which contains the functions which main() uses to create .bmp image files. You must also write the header file 'BMPfns.h' to #include in BMPmain.c and which contains prototypes of the functions defined in BMPfns.c . Problem2: BMPcheckerboard.c, BMPfns.c, BMPfns.h,...

  • Python Project

    AssignmentBitmap files map three 8-bit (1-byte) color channels per pixel. A pixel is a light-emitting "dot" on your screen. Whenever you buy a new monitor, you will see the pixel configuration by its width and height, such as 1920 x 1080 (1080p) or 3840x2160 (4K). This tells us that we have 1080 rows (height), and each row has 1920 (width) pixels.The bitmap file format is fairly straight forward where we tell the file what our width and height are. When...

  • It is a C++ program by using inheritance and vectors My professor said that all the files should be separate. like File.cpp, File.h, Text.cpp,Text.h,Main.cpp I already have these files File.cpp #inclu...

    It is a C++ program by using inheritance and vectors My professor said that all the files should be separate. like File.cpp, File.h, Text.cpp,Text.h,Main.cpp I already have these files File.cpp #include "File.h" // Constructor of File that takes File name and type as arguments File::File(string type, string name) {    this->type = type;    this->name = name; } //returns the type. string File::getType() {    return type; } //returns the name of file. string File::getName() {    return name; } File.h #ifndef __FILE_H__ #define...

  • the picture above is the one you are supposed to use for the MATlab code please...

    the picture above is the one you are supposed to use for the MATlab code please help Problems. Grayscale images are composed of a 2D matrix of light intensities from O (Black) to 255 (White). In this lab you will be using grayscale images and do 2D-array operations along with loops and iflelse branches. 1. We can regard 2D grayscale images as 2D arrays. Now load the provided image of scientists at the Solvay Conference in 1927 using the imread)...

  • from PIL import Image import random # NOTE: Feel free to add in any constant values...

    from PIL import Image import random # NOTE: Feel free to add in any constant values you find useful to use BLACK = (0, 0, 0) WHITE = (255, 255, 255) # NOTE: Feel free to add in any helper functions to organize your code but # do NOT rename any existing functions (or else, autograder # won't be able to find them!!) # NOTE: The following function is already completed for you as an example # You can use...

  • Need help starting from question 9. I have tried multiple codes but the program says it is incorrect. Case Problem 1 Da...

    Need help starting from question 9. I have tried multiple codes but the program says it is incorrect. Case Problem 1 Data Files needed for this Case Problem: mi pricing_txt.html, mi_tables_txt.css, 2 CSS files, 3 PNG files, 1 TXT file, 1 TTF file, 1 WOFF file 0 Marlin Internet Luis Amador manages the website for Marlin Internet, an Internet service provider located in Crystal River, Florida. You have recently been hired to assist in the redesign of the company's website....

  • Your program should be capable of creating a ppm image of the flag of Benin • The new flag gener...

    Your program should be capable of creating a ppm image of the flag of Benin • The new flag generated should use the proper width-to-height ratio as defined on Wikipedia for the flag. o For the colors, use pure red, and yellow, and a value of 170 for green. ▪ Pure color values are talked about in Lab 6. o The left green field should be 6/15ths of the width of the flag. Variables country_code should also include a new...

  • Fit to page ID Page view A Re - + of the cropped tile, width (int)...

    Fit to page ID Page view A Re - + of the cropped tile, width (int) is the width of the cropped tile Retur ed image that is a 3D list of int Example crop ([ LLU ,1, ,2,2), (3,3,3]], [(4,4,4], [5,5,5),(6,6,6]], [[7,7,7], [8,8,8], [9,9,9]] ), (0,0), 1, 2) [[[1,1,1], [2,2,2]]] color2gray(image) Description: It takes a color image (3D list) and returns a new grayscale image (2D list) where each pixel will take the average value of the three color...

  • #PYTHON# In this exercise you will write code which loads a collection of images (which are...

    #PYTHON# In this exercise you will write code which loads a collection of images (which are all the same size), computes a pixelwise average of the images, and displays the resulting average. The images below give some examples that were generated by averaging "100 unique commemorative photographs culled from the internet" by Jason Salavon. Your program will do something similar. Write a function in the cell below that loads in one of the sets of images and computes their average....

  • use MATLAB to upload the following: an image that you want to process (can be taken...

    use MATLAB to upload the following: an image that you want to process (can be taken yourself or downloaded from the internet) a script that processes the image in TWO ways. manipulates the colors averages pixels together Please make sure the script displays the images (like how I did with the 40 and 80 pixel averaging) so I can easily compare them to the original. Make sure to COMMENT your code as well. Homework 13 Please upload the following: an...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT