How to select irregular area in a pic.

3 ビュー (過去 30 日間)
Nisar Bahoo
Nisar Bahoo 2019 年 6 月 8 日
回答済み: Vishnu Vardhan 2019 年 6 月 8 日
Hello! I am working on a project in which i have to select a circular or irregular area and blur the background or the outer area of the selected area. as i have applied smoothing filter to blur the pic but i am having difficulty in selecting area. Can anyone please help me in selecting the shape and aplying the filter only on the outer side of selected shape. And also how can i take selection input from user.

採用された回答

Vishnu Vardhan
Vishnu Vardhan 2019 年 6 月 8 日
To find the area you may need to segment your image. If you just want to define the area's vertices somehow, like with roipoly() or imfreehand(), then you can get the area with polyarea(). However if the area is defined by something like intensity, texture, or whatever, then you need to segment the image. Segmentation means undergoing a series of steps such as filtering or morphology or something until you eventually get to an image that can be thresholded to form a binary image (your segmented image). With that binary image you can then label it with bwlabel() or bwconncomp() and then call regionprops(). Or you can call bwarea() for a different definition of area, weighted by how the boundary winds around, whereas regionprops() gives area as a simple count of pixels in the blobs.

その他の回答 (0 件)

製品


リリース

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by