| |
Methods defined here:
- __del__(self)
- __init__(self, *args, **kwargs)
- compute_LoG_image(self)
- This method computes the Laplacian-of-Gaussian (LoG) of an image. The LoG is
calculated as the difference of two Gaussian-smoothed versions of the input
image at two slightly difference scales. The LoG itself is NOT used in
watershed calculations.
- compute_Z_level_sets_for_gradient_image(self)
- For any value of n between 0 and 255, both ends inclusive, a pixel is in the
set Z_n if the gradient value at that pixel is less than or equal to n. Note
that the gradient values are normalized to be between 0 and 255.
- compute_gradient_image(self)
- The Watershed algorithm is applied to the gradient of the input image. This
method computes the gradient image. The gradient calculation is carried out
after the image is smoothed with a Gaussian kernel whose sigma is set in the
constructor.
- compute_influence_zones_for_marks(self)
- Calculates the influence zones in a binary blob with respect to the marks
placed inside the blob. The method also identifies the pixels at the
geodesic skeleton formed by the influence zones.
- connected_components(self, data_or_marks)
- This method is the basic connected components algorithm in the Watershed
module. Just for programming convenience related to the I/O from this
method, I have made a distinction between carrying out a connected-components
labeling of a binary image and doing the same for a binary pattern that
contains all of the marks made by the user.
- dilate(self, structuring_element_rad, structuring_ele_shape)
- This is to just demonstrate the basic idea of dilation of a binary pattern by
a disk structuring element whose radius is supplied as the first
argument. The precise shape of the structuring element, which can be either
"square" or "circular", is supplied through the second argument. This method
itself is NOT used in the watershed calculations. For large binary patterns,
it would be more efficient to carry out the dilations only at the border
pixels.
- dilate_mark_in_its_blob(self, mark_index)
- This method illustrates distance mapping of a blob in a binary image with
respect to a mark created by clicking at a point within the blob.
- displayImage(self, argimage, title='')
- Displays the argument image. The display stays on for the number of seconds
that is the first argument in the call to tk.after() divided by 1000.
- displayImage2(self, argimage, title='')
- Displays the argument image. The display stays on until the user closes the
window. If you want a display that automatically shuts off after a certain
number of seconds, use the previous method displayImage().
- display_data_image(self)
- This is just a convenience method for displaying the image that you want to
subject to watershed segmentation.
- display_watershed(self)
- Displays the watershed segmentation of the image in the grayscale mode. That
is, the image shown is what the computations are carried out on --- a
grayscale version of the input image (assuming it was a color image).
- display_watershed_contours_in_color(self)
- Shows the watershed contours as extracted by the extract_watershed_contours()
method.
- display_watershed_in_color(self)
- Displays the watershed segmentation on top of the original color image
(assuming that the input image was a color image to begin with.)
- erode(self, argimage, structuring_element_rad, structuring_ele_shape)
- This is to just demonstrate the basic idea of erosion of a binary pattern by
a disk structuring element whose radius is supplied as the first argument.
The precise shape of the structuring element, which can be either "square" or
"circular", is supplied through the second argument. This method itself is
NOT used in the watershed calculations.
- extract_data_pixels(self)
- Gets the binary, grayscale, and color images ready for watershed processing.
If the images are too large, they are reduced to the size set by the
constructor. Color images are converted into grayscale images.
- extract_watershed_contours(self)
- This method uses the border following algorithm to extract the watershed
contours from the final propagation of influences by the propagate_influences
method.
- mark_blobs(self)
- For demonstrations of distance mapping of a binary blob with respect to a
marker blob, this method allows a user to both select one or more blobs in a
binary image for the purpose of distance mapping and to also place marks on
the blobs.
- mark_blobs_no_image_scale_change(self)
- For demonstrations of distance mapping of a binary blob with respect to a
marker blob, this method allows a user to both select one or more blobs in a
binary image for the purpose of distance mapping and to also place marks on
the blobs.
- mark_image_regions_for_gradient_mods(self)
- For watershed segmentation that incorporates user-supplied modifications to
the image gradients, this method allows a user to demarcate through mouse
clicks polygonal regions where the gradient can be explicitly set to 0. For
each region thus demarcated, the mouse clicks must be supplied in a clockwise
fashion.
- modify_gradients_with_marker_minima(self)
- After a user has demarcated the regions in which the image gradients can be
modified, this method carries out the gradient modifications.
- propagate_influence_zones_from_bottom_to_top_of_Z_levels(self)
- Basic to watershed computation is the calculation of influence zones of the
connected components for one Z level in the connected components in the next
Z level. Note that we stop at one level below the max level at which Z sets
are known. That is because the last IZ calculation consists of finding the
influence zones of the Z sets at the 'self.max_grad_level-1' level in the Z
sets at the 'self.max_grad_level' level.
Static methods defined here:
- gendata(feature, imagesize, position, orientation, output_image_name)
- This method is useful for generating simple binary patterns for checking the
validity of the logic used for dilation, erosion, IZ calculation, geodesic
skeleton calculation, etc. Note that the permissible values for the
'feature' parameter are: 'line', 'triangle', 'rectangle', and
'broken_rectangle'. The parameter 'imagesize' is supposed to be a tuple
(m,n) for the size of the output image desired. The parameter 'position' is
supposed to be a tuple (x,y) of pixel coordinates for specifying the position
of the binary pattern in your image. The parameter 'orientation' is an
integer value specifying the number of degrees of rotation that should be
applied to the pattern for a given 'feature'. Note x is along the horizontal
direction pointing to the right and y is along vertical direction pointing
downwards.
- make_binary_pic_art_nouveau(under_what_name)
- Can be used to make "fun" binary images for demonstrating distance mapping of
binary blobs, calculation of influence zones, etc. This method is taken from
Chapter 13 of my book "Scripting with Objects".
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Data and other attributes defined here:
- canvas = None
- drawEnable = 0
- region_mark_coords = {}
- startX = 0
- startY = 0
|