"bwtraceboundary" help in matlab

Hi, I am having trouble using the built-in function. Previously, I was able to use bwboundary for other images to get boundaries. However somehow, for certain image I am currently analyzing, I am not able to get the boundary array. I get empty array. Below is the code
cropi = i(start_row:264, start_col:626, :);
boundary_left = bwtraceboundary(cropi, [85, 33], 'W', 8, 10, 'clockwise');
boundary_top = bwtraceboundary(cropi, [16, 3], 'S', 8, 10, 'counterclockwise');
[85, 33] and [16,3] are strating points and I specified the directions as above. Although the image is similar to others I analyzed previoulsy, I get empty array. I wasn't able to upload image but if needed I will send in email.
Thank you very much :)

Answers (1)

Image Analyst
Image Analyst on 31 Jul 2012
You have a 3D image. You're getting rows start_row to 264, and columns from start_col to 626, and all slices (or all color channels) from the (very badly-named) i. Exactly how do you intend it to trace a boundary in 3D?

2 Comments

This is not 3-D but 2-D gray scale image. It would be clear if I posted the image. Thank you very much for comment. I was able to figure out the error I was having.
Have a nice day.

Sign in to comment.

Asked:

on 31 Jul 2012

Community Treasure Hunt

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

Start Hunting!