Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (9)

Sign In or Sign Up now to post a comment!
  • tip: replace img = im2bw(img); with img = im2bw(image); and you can keep original image with detection. Thank you very much! Really good code!

  • wow, it works :o here's the code for those who want it: image = imread('shit.jpg'); img = im2bw(image); imshow(img); [label num] = bwlabel(img, 8); graindata = regionprops(label, 'all'); for i = 1:num if graindata(i).Eccentricity < 0.2 found = i; area = graindata(found).Area radius=sqrt(area/pi); radius=1.2*radius; centroid = graindata(found).Centroid; t= 0:pi/20:2*pi; x=centroid(1)+radius*cos(t); y=centroid(2)+radius*sin(t); hold on; plot(x,y); end end
  • the link is not working

  • I just click on 'full screen'.. its a + no a * ... now all is clear.. thank you so much

  • I'm checking the code, its interesting. I don't know how exactly this part works: x = centroid(1)*radious*cos(t); y = centroid(2)*radious*sin(t);...­. it seems we need to identify the centroid first and start to draw the circle, but, here you are multipliying the centroid... how was that?

  • What the hell ? Where is the circle detection ?

  • Sir . . i tried the code which gets displayed here ..but it didint work ...wht is img8? i did create shapes.jpg but error occured ... cn u guide me plz !!!

  • can you show me the code please? thanks

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more