Design a C or C++ (ANSI standard) program that can extract object edges and detect the presence of straight lines.
BACKGROUND
Automated visual quality control and visual monitoring of industrial assembly lines are the application areas where computer vision has proven its efficiency. Vision systems can operate continuously and provide measurement of critical parameters such as position and orientation of objects, their shape, colour, etc. An obvious advantage of such systems is the possibility of controlling image acquisition process optimising illumination, position of cameras and background colour. As a result, images used for automated visual inspection have good quality in terms of contrast and SNR.
Your program shall include the following stages:
- Rescale the image down by the factor of 2, to reduce computational complexity of the subsequent stages
- Extract boundaries of objects using 33 gradient operators
- Save the generated b/w image bmp
- Detect the presence of straight lines and measure their orientation with the precision 3o
- Extract boundaries of objects using binary morphology
- Save the generated b/w image bmp
- Detect the presence of straight lines and measure their orientation with the precision 3o Compare performance and efficiency of both methods and reflect your observations, findings and conclusions in the report assignment2report.txt
DESIGN SPECIFICATION
You need to use OpenCV library to implement the solution.
It can be tested using asm2.bmp test image. Since information about colour is not required, it contains only 8bit/pix luminance component. The image size is 640480.
Your program shall produce:
- Two 8bit/pix black/white (b/w) images bmp and morphology.bmp ( size 320240), which represent object boundaries obtained by two boundary extraction methods. The level of background should be set to 0 (black), while the pixels corresponding to boundaries are set to 255 (white).
Comments: You may try to apply a LPF before the gradient-based method to improve overall accuracy of edge detection. If needed, you can also apply binary morphological methods ( erosion, dilation, etc) to smooth boundaries obtained as a thresholded output of the gradient-based method.
Considering the second solution, before applying the morphological boundary detection method, you need to binarize the input image first. The test image provided has a very high contrast and therefore selection of a threshold is not very difficult. For asm2.bmp the threshold can be set around 90-100.
- For each boundary detection method you need to printout parameters of all detected lines in the following format:
Line detection in a b/w image produced by gradient operators:
Line 1 is detected. Orientation = degrees Line 2 is detected. Orientation = degrees or
No straight lines detected
Having implemented and tested the program, you should investigate some practical aspects of boundary extraction and straight-line detection. For example:
- You can compare accuracy and computational complexity of two boundary detection methods
- You can evaluate efficiency of edge detection with LPF pre-processing and without it
- You can measure computational complexity and execution time of Hough Transform You can analyze sensitivity of your system to noise by running the program with the second test image bmp
Your observations, findings and conclusions must be summarized in the report assignment2report.txt
Reviews
There are no reviews yet.