Video Writer for cycle detection

조회 수: 3 (최근 30일)
Amir Azadeh Ranjbar
Amir Azadeh Ranjbar 2022년 8월 12일
댓글: Amir Azadeh Ranjbar 2022년 8월 13일
clc;clear all;close all
v = VideoWriter('cycles1','MPEG-4');
open(v);
Web=webcam;
k=1;
while k<200
frame=Web.snapshot;
[centers,radii] = imfindcircles(rgb2gray(frame),...
[8,30],"ObjectPolarity","dark",...
"Sensitivity",0.8,...
"Method","TwoStage");
imshow(frame)
h = viscircles(centers,radii,"Color",[0.2 0.3 0.5]);
writeVideo(v,frame);
k=k+1;
end
close(v)
clear Web
% I Wanr Write Video With Cycle that detected
  댓글 수: 1
Benjamin Thompson
Benjamin Thompson 2022년 8월 12일
Do you mean cycle detection or circle detection?
Is there an error or some problem with your sample code that you can post here?

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

채택된 답변

Benjamin Thompson
Benjamin Thompson 2022년 8월 12일
You can use frame2im(getframe(gcf)) to get an image that has the result of imshow and viscircles together.
  댓글 수: 1
Amir Azadeh Ranjbar
Amir Azadeh Ranjbar 2022년 8월 13일
Its Work Perfect
Thanks Benjamin Thompson

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by