how apply sliding window on the image to find certain object ?

조회 수: 1 (최근 30일)
Samir khan
Samir khan 2018년 7월 19일
댓글: Samir khan 2018년 8월 13일
i am using a trained network to classify but i want to know how can i apply sliding window on the image to classify. my code is ..
clc; clear; close all;
%% load the network net= alexnet; layers=net.Layers;
%% create datastore
imds=imageDatastore('imagedata',... 'IncludeSubfolder',true,... 'LabelSource','foldernames');
%% Split datastore into training and test set
[trainset, testset]=splitEachLabel(imds,2000);
%% modify the last two layers of the network
layers(end-2)=fullyConnectedLayer(2); layers(end)=classificationLayer;
%% set the training options
opts=trainingOptions('sgdm',... 'InitialLearnRate',0.001,... 'ExecutionEnvironment','gpu',... 'MiniBatchSize',64,... 'Plots','training-progress','CheckpointPath','C:\Users\trainee2018167\Documents\MATLAB','MaxEpochs',20);
% 'ValidationData',validationImages,... %
%% train the network
[newnet1, info]=trainNetwork(trainset,layers,opts);
%% saving
save newnet;
%% Predict data on test image
% dtermine actual and predicted result
act=testset.Labels;
predict=classify(newnet1,testset);
can you tell me how can i do it!!!
  댓글 수: 3
Samir khan
Samir khan 2018년 8월 13일
use nfilter or blockpro for sliding window. These function automatically slides over the image.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Data Workflows에 대해 자세히 알아보기

제품


릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by