Hi All,
Could you please give me a hand! I am currently writing up some cell analysis code that looks at a cell's radius and see's its change in size over time. At the moment I have gotten the edge detection software working fine but the video seems to be picking up uncessesary noise and I would really like to improve the image quality beofre I move to the next stage.
This is my code for the edge detection:
%% vidobj is input VidioReader Object
vidobj = VideoReader('VID00126.AVI');numframes = get(vidobj, 'NumberOfFrames'); %% finalvid is output VideoWriter Objectfinalvid = VideoWriter('edgedetVID00126.avi');finalvid.FrameRate = vidobj.FrameRate;open(finalvid);c = 1;for ii = 1 : 17 if rem(numframes,ii) == 0 if c < ii c = ii; end if c == 1 c = 10; end endendstartframe = 1; stopframe = c; while (stopframe <= numframes) frames = read(vidobj, [startframe stopframe]); for l = 1:size(frames,4) temp = frames(:,:,:,l); temp = rgb2gray(temp); detectedge = edge(temp, 'canny'); detectedge = single(detectedge); writeVideo(finalvid, detectedge); end startframe = startframe + c; stopframe = stopframe + c;endclose(finalvid);
I have been trying to use the following link's code to change the gradient but it only seems to be working for images, could anyone tell me what I could do?
Thanks in advance everyone.
Ben
Best Answer