implay a video and draw n points with ginput

4 ビュー (過去 30 日間)
laurent jalabert
laurent jalabert 2022 年 12 月 21 日
コメント済み: prasanth s 2022 年 12 月 22 日
Hello, I have intensively tried to find any code to do that, but I could not find. So I am sorry to post my question here.
I have a mp4 video (on Mac), I use implay to see the video. This works. Now, I would like to draw N points using ginput function on the implay window.
My understanding is that it is not possible, because the video reader is not a figure. I guess ginput was designed to work only on figure.
So my request is maybe not relevant. My goal is to show a video, and let the user point out several areas (point or pixel) of interest, get the (x,y) coordinates of those points, and then, retrieve the blue pixel intensity versus time. So thanks to ExtractMovieFrame.m program from
I could already get the profile on 1 single point that I defined in my program with x=350 and y=350. But this was not graphically selected on the picture or on the video. This is what I would like to do : to get the position of 3 or 4 points that will be defined using a kind of ginput(4).
Could you help me ?
  2 件のコメント
KSSV
KSSV 2022 年 12 月 21 日
[x,y] = ginput(4)
OR
[x,y] = getpts() ;
laurent jalabert
laurent jalabert 2022 年 12 月 21 日
Well, maybe I was not clear.
If you run any video using :
implay(movieFullFileName)
then, how can you use [x,y] = ginput(4) relatively to the implay window ?
What I explain in my problem, is that ginput is refered to a figure, not to a implay. So I was looking for a kind of similar function of ginput but for being applied to a displayed video. Sorry for my misleading problem introduction

サインインしてコメントする。

採用された回答

prasanth s
prasanth s 2022 年 12 月 21 日
try:
h=implay(video)
[x,y] = getpts(h.Visual.Axes)
  3 件のコメント
laurent jalabert
laurent jalabert 2022 年 12 月 22 日
do you know how to add this getpts function into the menu of the implay window ?
prasanth s
prasanth s 2022 年 12 月 22 日
no

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeComputer Vision with Simulink についてさらに検索

タグ

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by