Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function [cechy, obiekt, obr_bw] = obr2cechy(obraz,tlo)
- obr_r = imabsdiff(obraz,tlo);
- obr_bw = im2bw(obr_r,graythresh(obr_r));
- [obr_ind, il_ob] = bwlabel(obr_bw);
- pow_max = bwarea(obr_ind==1);
- ind_max = 1;
- for i=2:il_ob
- pow = bwarea(obr_ind==i);
- if pow > pow_max
- pow_max = pow;
- ind_max = i;
- end
- end
- obiekt = (obr_ind==ind_max);
- cechy = [niezm1(obiekt), niezm2(obiekt), niezm3(obiekt), niezm4(obiekt), niezm5(obiekt), niezm6(obiekt), niezm7(obiekt)];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement