how to return array of images from a function
显示 更早的评论
hi i have a function that take an image and segment this image into many images and i want to return all of these images to use them in another function can any one help thank you .
1 个评论
Stephen23
2016-2-24
Simply put them into a cell array and return the cell array.
回答(2 个)
Image Analyst
2016-2-24
0 个投票
Binu
2016-2-24
0 个投票
Try bwlabel(2D) or bwlabeln(3D or higher). Each segmented chunk will be assigned a number label. It returns the label matrix that contains labels for 8 or 24 connected components.
function BW = segmentImages(Image) out = segment(Image); % your segmentation function BW = bwlabel(out); end
类别
在 帮助中心 和 File Exchange 中查找有关 Image Processing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!