Hello, if you have any need, please feel free to consult us, this is my wechat: wx91due
CSE 327 Computer Vision Pro ject 1
You will be given a program for edge detection based on thresholding the magnitude of the gradient as a template. Use this to complete the following programs.
Gray-scale images of size 256 X 256 with 8 bits/pixel is provided in SUN raster format (test1.ras, test2.ras, and test3.ras). The image contains one or more ob jects on a background of uniform brightness. You are required to isolate the ob jects from the background by thresholding the image and determine the area, position, and orientation of each of the ob ject in the image. Write a program to do the following.
1. (20 points) Read an image file and print the histogram of the image into a file hist.txt. Inspect the histogram visually and pick a threshold for binarizing the image. Use the threshold to binarize the image with 20 and 200 as background and foreground brightnesses respectively and write the result into a file named bin-img.ras. Display and view the binary image.
2. (40 points) In the binary image, assign a common label to all connected components. Create a a grey-scale image where the pixels of each connected component will have the same pixel value, distinct from the other connected components. Use 8-connectedness denition in computing the connected components. Recursive algorithms for connected component labeling should not be used. Write the result into a file named label-img.ras.
3. (40 points) Compute and print the area, position, and orientation of all the connected components with an area greater than 30 pixels.
The input-output routines for basic input/output of gray-level Sun raster files rasio.c, rasio.h and the sample program of edge detection by using these subroutines and edge2.c can be found in the course web page:
http://www.cs.sunysb.edu/~cse327
You will need to submit the source code of the functions for histogram computation, thresholding, connected component labeling, and area, position, and orientation computation. Also, for each of the test images test1.ras, test2.ras, and test3.ras, the images bin-img1.ras, bin-img2.ras, binimg3.ras, and label-img1.ras, label-img2.ras, label-img3.ras respectively and the results of number of connected components, area, position, and orientation computation.
Submission will be done through the computer science transaction lab. The programs will have to compile in a Windows environment. You will be given your accounts and further instructions in class next Thursday.