how to return array of images from a function

조회 수: 4 (최근 30일)
Zeinab Abd ElMonam
Zeinab Abd ElMonam 2016년 2월 24일
답변: Binu 2016년 2월 24일
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
Stephen23 2016년 2월 24일
Simply put them into a cell array and return the cell array.

댓글을 달려면 로그인하십시오.

답변 (2개)

Image Analyst
Image Analyst 2016년 2월 24일
Perhaps code for that in the FAQ will help.

Binu
Binu 2016년 2월 24일
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

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by