how can i save the image and roi to train classifier

조회 수: 2 (최근 30일)
matlab22
matlab22 2016년 4월 11일
답변: Dima Lisin 2016년 4월 14일
i use this code
axes(handles.axes1)
h=imrect;
position = round(wait(h));
curImg=1;
I=imread(strcat(pathname, filename{k}));
[rows, columns, numberOfColorBands] = size(I);
% Crop image
I2 = imcrop(I,position);
figure;
imshow(I2);
data(curImg).imageFilename = I;
data(curImg).objectBoundingBoxes = position;
curImg = curImg + 1;
I select roi than i extract the position and i save the pathname and the position of the roi, when i use the struct data to train classifier it dosen't work, here is the code:
trainCascadeObjectDetector('Detector.xml',data,negativeFolder,'FalseAlarmRate',0.2,'NumCascadeStages',5);
i get struct with 2 field and 1 column rows are:imageFilename and objectBoundingBoxes.

답변 (1개)

Dima Lisin
Dima Lisin 2016년 4월 14일

카테고리

Help CenterFile Exchange에서 Image Processing and Computer Vision에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by