The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
untitled Matlab Code
Posted by: George Buckenham | February 24, 2009 @ 7:13am
Matlab Code
[
Download
]
% load background image directory = '/group/project/VISION/web/AV2/DATA2/frame'; data = [ directory, 'bg' , '.jpg']; bgim = imread(data, 'jpeg'); %import image %magic numbers threshold = 13; opening = 5; connopening = 200; for i = 1:146 im = latest_im(directory, i); subim = abs(bgim -im); binim = subim > threshold; binim = binim(:,:,1) | binim(:,:,2) | binim(:,:,3); erodedim = bwmorph(binim,'open', opening); erodedim = bwmorph(binim,'close', opening); erodedim = bwareaopen(erodedim,connopening); labeledim = bwlabel(erodedim, 8); % bwim = im2bw(subim, threshold); figure(1); imagesc(labeledim); pause(0.1); end
Syntax Highlighting
[
Open in new window
]
Author Comments
none
Rating
4.56 / 8
149 Votes