I have the following code which works perfectly but for the 'pix' field.
My code is:
mydir = 'E:\matlab\pet_dog\';fid=fopen('E:\matlab\ratio for pet_dog.txt','wt');allentries = dir(mydir);diridxs = [allentries.isdir];alldirs = allentries(diridxs);allfiles = allentries(~diridxs); for ctr = 1:length(allfiles) x = fullfile(mydir, allfiles(ctr).name); pix = double(nnz(edge(rgb2gray(imread(x))))); %disp(pix);
ratio = fix(9600/pix); logintimeout(5); con = database('fetchDB', '', ''); ping(con); exdata = {'9600',pix,'-',ratio,x}; colnames = {'imgSize', 'imgPixel', ' imgPart','ratio','imgName'}; fastinsert(con, 'animal', colnames, exdata) close(con);end
Why the field 'imgPixel' is not showing the numerical values properly? What should I do?
Best Answer