Hello, I need some help with a little project. I must split a program into dedicated functions for each task. There are two functions. The first function converts the RGB image into BW. The second function should allow the selection of a point with the mouse on the BW image returned by function 1, and output the point's coordinates. I haven't had any success yet. Can someone guide me please? Thanks in advance!
Here is the code:
>function mediere(I) >% I este o imagine >global BW; >gray=rgb2gray(I); >figure, imshow(gray), title('imaginea obtinuta dupa rgb2gray'); >AVG = medfilt2(gray, [5 5]); %se calculeaza o medie cu pixelii vecini >figure, imshow(AVG), title('imaginea obtinuta dupa medfilt2'); >BW=im2bw(AVG, graythresh(AVG)); >figure, imshow(BW), title('imaginea obtinuta dupa graythresh'); >end