Assignment #5
Due to: Fr. Oct.17th, date negotiable :-)
Score: 5 points
The programs must be sent to the TA as MATLAB-scripts.
This time it's 'real' computer vision!
Your task: write a program that counts objects in a binary black and white image,
using morphological operators.
Use the following image to check your program:
Remarks:
- A single object is defined as an 8-connected foreground-region
- Foreground is defined to be white
- You will need the following MATLAB functions:
- imdilate (dilation)
- bitand (intersection)
- imabsdiff (abs. difference)
- If there are problems with data-types: uint8() converts a double-matrix to uint8 (the format you need for bitand)
Hints:
- Write a function that finds a single connected region, using formula 9.5-3 of the textbook
- Subtract the region found from the original image
- Do this until no further foreground region is left
Have fun !