CSE/EE 485: Digital Image Processing IComputer Project Report # : Project 1Image Transformation Using Boolean Operations / Component AnalysisGroup #4: Isaac Gerg, Pushkar DurveDate: September 25, 2003 |
|||||||||||||||||||||||
|
|||||||||||||||||||||||
A. |
Objectives
|
||||||||||||||||||||||
B. |
Methods There are two 'M' files for this project. The M file concerning Boolean operations and image differences is called project1a.m. The M file concerning connected-components is called project1b.m. project1a.m contains five parts. A, B are image objects.
1. Computing of A AND B. project1b.m contains 1 part 1. Connected-component analysis using generated image via CHECKERBOARD function along with the BWLABEL function. Executing project1a.m from Matlab At the command prompt enter:
Executing project1b.m from Matlab At the command prompt enter:
|
||||||||||||||||||||||
C. |
Results Image file names in parentheses.
Part 1
Figure 3 was as expected as both images must contain a corresponding white pixel to realize a corresponding white pixel in the final image, Figure 3.
Figure 4 was as expected as both images must contain different corresponding pixels to realize a corresponding white pixel in the final image, Figure 4. Part 3 Figure 5: [NOT(A) XNOR NOT(B)]. (image_XNOR.jpg) By following a truth table it was determined that our complex Boolean function operated correctly. Part 4
Part 5
These difference mechanisms may track live motion as shown above. Motion among the human figures is highly probable given the context of the source images and the setting they depict. Connected-Components Analysis A checkerboard patterned image was created using the CHECKERBOARD function. This image was used as our test image (checkerboard.png). Then, we applied the BWLABEL function to our image object of the checkerboard to determine the number of connected objects in the image object. We performed an analysis of 4 and 8-connectivity.
Figure 13: The test image used for 4 and
8-connectivity analysis. The results of our analysis are below:
As expected, there is only one connected component for 8-connectivity and 32 for 4-connectivity. In 4-connectivity, none of the white pixels are contained within another white pixels N4 set. Therefore each white pixel is its own connected component therefore having 32 connected components because there are 32 white pixels in an 8x8 checkerboard image. In 8-connectivity, all of the white pixels are contained within another white pixels N8 set. Therefore each white pixel is connected to every other white pixel. The N8 set has four more degrees of freedom that N4. As expected, there are less connected components realized in 8-connectivity. N4 = {(x+1,y), (x, y+1 ), (x -1,y), (x,y-1)} N8 = {(x+1,y), (x, y+1 ), (x -1,y), (x,y-1), (x+1, y+1), (x-1,y-1), (x+1, y-1), (x-1, y+1)}
Summary
|
||||||||||||||||||||||
D. |
Conclusions Boolean operations can be performed on binary images of the same matrix dimensions. These operations are commonly used as masking functions. This allows for a subset of the image to be display or not displayed. Using complex Boolean expressions, one can create inverse patterns and other such detail features that may be effective for study. The AND operation preserves any corresponding image pixel pair if both pixels are 1. This could be used for elementary image masking. The XNOR operation preserves any corresponding image pixel pair if both pixels are the same value. This could be used to highlight similarities of a binary image. The XOR operation preserves any corresponding image pixel pair if the pixels have different values. This could be used to highlight differences in a binary image. The MAX function returns the maximum quantized gray level value for a corresponding pixel pair in two images. This can be used to blend images in a visually appealing way. Alternatively, this could also be used in scientific research to combine two data sets of relief data to study their combined effects. (eg. 2 plots of tissue density) The IMSUBTRACT and IMABSDIFF functions operates on a corresponding image pixel pair returning their difference value. IMSUBTRACT differs from IMABSDIFF in that if the difference in a pixel pair is negative it 'grounds' the value to zero. IMABSDIFF will never return a negative value as it returns the absolute difference of a pixel pair. These functions are useful in motion tracking and video compression (MPEG). Connected components are useful because they provide a
mechanism to measure uniformities of pixel neighborhoods. They can be
particularly useful in scientific application where the relationship among 2D
data set is important. In the real-world, this could be used to determine lines
or other curved and thin objects of an image as their neighboring pixels will
have some intensity similarities. |
||||||||||||||||||||||
E. |
Appendix project1a.m source code. project1b.m source code.
|
||||||||||||||||||||||
|