How do I save a histogram after I extract the LBP feature?
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello everyone, I am currently working on an age-invariant face recognition system. I started off implementing a face detection algorithm, then close cropping it, and turning it into a grayscale image. Then I applied LBP feature extraction and normalized the histogram. Now I want to save all the value of the histogram for further face recognition process. Here are my codes .
clear all
clc
%Detect objects using Viola-Jones Algorithm
%image directory
imgdir = 'C:\Users\PC\Documents\MATLAB\testingimage';
DestDir = 'C:\Users\PC\Documents\MATLAB\croppedimage';
%To detect Face
FDetect = vision.CascadeObjectDetector;
I = imread('sub1img1.jpg');
%Returns Bounding Box values based on number of objects
BB = step(FDetect,I);
for i = 1:size(BB,1)
rectangle('Position',BB(i,:),'LineWidth',5,'LineStyle','-','EdgeColor','r');
croppedimage = imcrop(I,BB(i,:));
%check if image is gray, if not, convert to gray
if size(croppedimage, 3) == 3
croppedimage = rgb2gray(croppedimage);
end
end
% Apply local binary pattern feature extraction
mapping = getmapping(8,'u2');
H1 = lbp(croppedimage,1,8,mapping,'nh'); %LBP histogram in (8,1) neighborhood
%stem(H1); %using uniform pattern
댓글 수: 0
답변 (1개)
Soma Ardhanareeswaran
2016년 10월 21일
You can save the workspace variables and retrieve it into MATLAB using the 'save' and 'load' commands. Refer to https://www.mathworks.com/help/matlab/matlab_env/save-load-and-delete-workspace-variables.html
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Feature Detection and Extraction에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!