No bwconvhull function, how else can it be done? Plus: Slider for 'radius' of hull

1 view (last 30 days)
Hello, after long research I found out, that I need the function bwconvhull for my code, but my company's Matlab version doesn't have it (Version 7.11.1, from 2010). Upgrade is not helpful, since my collegues also have to use the code with their "old" version.
Basically my problem is: I have left a few objects in my binary image and want to make ONE good fitting boundary around ALL those white, disconnected areas. I guess bwconvhull would do it as I wanted. What else can I try?
subplot(2, 4, 7);
whos binaryImage
binaryImage = bwconvhull(binaryImage, 'union');
which bwconvhull
imshow(ConvHull);
title('Union Convex Hull');
gives
??? Undefined function or method 'bwconvhull' for input arguments of type 'char'.
Also, if possible, I would like to have a slider below the figure of my picture (which already shows the hull), where i can choose the "radius" of my hull. When i connect two circles, I would like to be able to change how much the hull tightens between the circles, either it will be one ellipse (you cannot see the original circles anymore) or basically two circles connected with one line. (Doing omething similar as bwareaopen etc.) Hope you understand what I mean - see picture. The slider should be below the picture, at bottom part of (2,4,7). Some slider callback?
Thank you for any help.
  1 Comment
NeedHelp
NeedHelp on 20 Oct 2015
is it possible to use one of these options instead?
convexHull(DT),
convhulln(X), or
regionprops(binaryImage,'ConvexHull');
I need to "measure" some errors on photographs which have white objects on the outside but the black parts between the whites and on the inside also have to be counted, so I need a good way to find the whole area around the few clear errors...
Please help me! :-)

Sign in to comment.

Answers (1)

Image Analyst
Image Analyst on 20 Oct 2015
No, you don't need bwconvhull(). What you need, according to your picture, is activecontour(). It's been around a while. Hopefully you have it. I've attached a demo of it.
You mght be able to start with the initial binary image. If you can't and you need to get the convex hull of the union, you can use find() on the binary image, then pass those rows and columns into convhull() to get the hull points. Then use poly2mask() to get the union convex hull.

Categories

Find more on Bounding Regions in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!