hi, How can I find the convex hull of binary image without any predefined function

4 views (last 30 days)
hi, How can I find the convex hull of binary image without any predefined function
as if i use this code , i just get inverted image not convex please tell me how could i find the exact convex hull of this image....
a=imread('coins.png');
b=im2bw(a);
[m,n]=size(b);
convimage=zeros(m,n);
while (40< b[m] < 364) && ( 219 < b[n] < 256)
for i=1:m
for j=1:n
if b(i,j)==o
convimage(i,j)=1;
end
end
end
imtool(convimage);
end
  1 Comment
Image Analyst
Image Analyst on 21 Mar 2013
Edited: Image Analyst on 21 Mar 2013
Why do you want to avoid built-in tools that make it trivial? If you want to do it the hard way, you can Google "convex hull code" and find web sites with code. Your code doesn't really do anything useful at all. By the way, what do the Coder and Compiler toolboxes have to do with this?

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!