Real-time video processing

Hi, I have just made a GUI of artificial vision. I have managed to do several operations but only in "fixed" images and I have three questions. I want to know what would be the best option to perform in "real time"? 1.- The timer function (a clear example of how it could be used?) 2.- The while function in infinite loop (How do you disable a while in infinite loop?) 3.- Any other function that you know? (I need to apply filters, masks and generate RGB / BW histograms) Thanks in advance
TIMER FUNCTION
https://www.mathworks.com/help/matlab/matlab_external/timerfcn.html?searchHighlight=timerfcn&s_tid=doc_srchtitle
I want to apply filters, masks and make histograms in "real time"

Answers (2)

I have no idea what you want in terms of an example for a timer. I'd start by reading
doc timer
You will find examples there.
A while is trivial though.
iter = 0;
while 1
iter = iter + 1;
if rand(1) < 0.00001
break
end
end
iter
iter =
230491
Or use a condition in the while statement itself.
iter = 0;
while rand(1) > 0.00001
iter = iter + 1;
end
iter
iter =
19420

1 Comment

I mean this function
https://www.mathworks.com/help/matlab/matlab_external/timerfcn.html?searchHighlight=timerfcn&s_tid=doc_srchtitle
I want to apply filters, masks and make histograms in "real time" but I want to know what would be the best option to perform it 1.- The timer function 2.- The while function in infinite loop 3.- Any other function that you know?

Sign in to comment.

Image Analyst
Image Analyst on 28 Jun 2017
My example of using a while loop to do stuff until you press a pushbutton is attached.

Categories

Asked:

on 23 Jun 2017

Answered:

on 28 Jun 2017

Community Treasure Hunt

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

Start Hunting!