Advertisement
Benlahbib_Abdessamad

Untitled

Jul 1st, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 2.60 KB | None | 0 0
  1. % --------------------------------------------------------------------
  2. function tophat_Callback(hObject, eventdata, handles)
  3. % hObject    handle to tophat (see GCBO)
  4. % eventdata  reserved - to be defined in a future version of MATLAB
  5. % handles    structure with handles and user data (see GUIDATA)
  6. image=handles.courant_data;
  7. se = strel('disk',30);
  8. b = imtophat(image,se);
  9. handles.ima_traite = b;
  10. axes(handles.imgT);
  11. subimage(b);
  12. handles.output = hObject;
  13. guidata(hObject, handles);
  14.  
  15. % --------------------------------------------------------------------
  16. function bottom_hat_Callback(hObject, eventdata, handles)
  17. % hObject    handle to bottom_hat (see GCBO)
  18. % eventdata  reserved - to be defined in a future version of MATLAB
  19. % handles    structure with handles and user data (see GUIDATA)
  20. image=handles.courant_data;
  21. se = strel('disk',30);
  22. b = imbothat(image,se);
  23. handles.ima_traite = b;
  24. axes(handles.imgT);
  25. subimage(b);
  26. handles.output = hObject;
  27. guidata(hObject, handles);
  28.  
  29. % --------------------------------------------------------------------
  30. function gradient_interne_Callback(hObject, eventdata, handles)
  31. % hObject    handle to gradient_interne (see GCBO)
  32. % eventdata  reserved - to be defined in a future version of MATLAB
  33. % handles    structure with handles and user data (see GUIDATA)
  34. image=handles.courant_data;
  35. se = strel('disk',3);
  36. b = imerode(image,se);
  37. img = image - b;
  38. handles.ima_traite = img;
  39. axes(handles.imgT);
  40. subimage(img);
  41. handles.output = hObject;
  42. guidata(hObject, handles);
  43.  
  44. % --------------------------------------------------------------------
  45. function gradient_externe_Callback(hObject, eventdata, handles)
  46. % hObject    handle to gradient_externe (see GCBO)
  47. % eventdata  reserved - to be defined in a future version of MATLAB
  48. % handles    structure with handles and user data (see GUIDATA)
  49. image=handles.courant_data;
  50. se = strel('disk',3);
  51. b = imdilate(image,se);
  52. img = b - image ;
  53. handles.ima_traite = img;
  54. axes(handles.imgT);
  55. subimage(img);
  56. handles.output = hObject;
  57. guidata(hObject, handles);
  58.  
  59. % --------------------------------------------------------------------
  60. function gradient_morphologique_Callback(hObject, eventdata, handles)
  61. % hObject    handle to gradient_morphologique (see GCBO)
  62. % eventdata  reserved - to be defined in a future version of MATLAB
  63. % handles    structure with handles and user data (see GUIDATA)
  64. image=handles.courant_data;
  65. se = strel('disk',3);
  66. a=  imerode(image,se);
  67. b = imdilate(image,se);
  68. img = b - a ;
  69. handles.ima_traite = img;
  70. axes(handles.imgT);
  71. subimage(img);
  72. handles.output = hObject;
  73. guidata(hObject, handles);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement