Data type mismatch with input 2; expected single, got uint8.?? for vision.templatematcher implementation on video.??

1 次查看(过去 30 天)
my code for template matching on video feed is
clear all ; close all; clc;
H=vision.TemplateMatcher;
H.SearchMethod='Three-step';
videoFileReader = vision.VideoFileReader('tedv.mp4');
videoPlayer = vision.VideoPlayer('Position', [100, 100, 680, 520]);
i = step(videoFileReader);
t=imread('tedp.PNG');
tgray=rgb2gray(t);
runLoop = true;
frameCount = 0;
while ~isDone(videoFileReader)
iGray = rgb2gray(i);
frameCount = frameCount + 1;
loc=step(H,iGray,tgray);
J=insertMarker(i,loc,'o','size',400);
% Display the annotated video frame using the video player object.
step(videoPlayer, J);
% Check whether the video player window has been closed.
runLoop = isOpen(videoPlayer);
end
release(videoPlayer);
release(H);
kindly review and tell me the mistake so that i could implement it on video feed.

回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by