Image Processing Toolbox | ![]() ![]() |
Selecting Objects in a Binary Image
You can use the bwselect
function to select individual objects in a binary image. You specify pixels in the input image, and bwselect
returns a binary image that includes only those objects from the input image that contain one of the specified pixels.
You can specify the pixels either noninteractively or with a mouse. For example, suppose you want to select objects in the image displayed in the current axes. You type
The cursor changes to a cross-hair when it is over the image. Click on the objects you want to select; bwselect
displays a small star over each pixel you click on. When you are done, press Return. bwselect
returns a binary image consisting of the objects you selected, and removes the stars.
See the reference page for bwselect
for more information.
![]() | Connected-Component Labeling | Finding the Area of Binary Images | ![]() |