MATLAB Answers

How to extract the features of an image frame and obtain the feature vector?

26 views (last 30 days)
Hi, I am doing my final year B.Tech project on abnormality activity detection in video using MATLAB. I wanted to know how to extract features from all the video frames and make a feature vector. Can anyone please help?
Thank You.

Accepted Answer

Walter Roberson
Walter Roberson on 12 Feb 2016
npix = 20;
nframe = 50;
FF = read first frame
N = numel(FF);
featidx = randperm(N, npix); %that is, 20 random indices for the image array
FV(:,1) = FF(featidx);
for framenum = 2 : nframe
FF = read frame #framenum
FV(:,framenum) = FF(featidx);
end
You now have a feature vector for each frame; FV will be npix by nframe with the feature vector for each frame going down the columns.
You might be thinking, 'Randomly selected pixels can't be a feature!!", but that would be incorrect. Every deterministic numeric function applied to the data matrix can be a feature. Taking the log of the average hue can be a feature. Taking the maximum intensity of the Green channel can be a feature. The function just has to be consistent about what it does.
The trick with image analysis is not extracting features: it is know what features to extract. And there is no one answer for that: features that are useful in one situation might be meaningless in another situation.
It is very common to extract a bunch of different features for each image, and then to do "feature selection", which is a process of figuring out which of the features is most useful in distinguishing between the various classes of data. It even turns out that random selection can be important ("compressive sensing") so do not dismiss it out of hand.
  17 Comments
Image Analyst
Image Analyst on 17 Feb 2017
I believe you'd have to have a tremendous amount of visible light ("illumination") to affect the temperature of an item. The sun has lots of infrared in it. If you filter out the infrared irradiance with an IR-cutoff filter, and just allow through illuminance (visible light), I doubt it would heat the sample even with 50,000 Lux (100 times office brightness). I know often a layman's inaccurate definition of illuminance includes all irradiance, not just visible light and including infrared, but my optics professor in grad school was a stickler for us using proper terms and units. He even published a paper on it (see attached paper).

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by