backlog

area__thersh___in__num__img

Apr 3rd, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.51 KB | None | 0 0
  1. x=imread('textt.png');
  2. %hold on%x=imread ('rc.jpg');%img=rgb2gray(x);
  3. umb=graythresh(x);
  4. bw=im2bw(x,umb);
  5. [l ne]=bwlabel(bw);
  6. pr=regionprops(l,'Area','BoundingBox');
  7. av=[pr.Area];
  8. id=find((500<=av)&(av<=10000));
  9. h=ismember(l,id);
  10. np=regionprops(h);
  11. whos h
  12. hold on
  13. for n=1:size(np,1)
  14.     rectangle('Position',np(n).BoundingBox,'EdgeColor','g','LineWidth',5)
  15. end
  16. hold on
  17. subplot(2,1,1)
  18. imshow(x); xlabel('originial image ');
  19. hold on
  20. subplot(2,1,2)
  21. imshow(h); xlabel('number detected image ');
Add Comment
Please, Sign In to add comment