MATLAB Answers


Difference between image processing in a loop

Asked by Adrian Lim on 13 Jul 2018
Latest activity Commented on by Adrian Lim on 14 Jul 2018
I'm currently doing object counting on a traffic light model. After I can count the vehicle, I'm trying to put the codes into a loop to get same results. The variables gotten in the loop is similar to the one that without the loop but I couldn't get the same results.
The area that it is counting is the road beside the vehicle while doing it in the loop.
hfig = figure;
while isvalid(hfig)
img = snapshot(cam);
('segmentation and counting code')
Are there any solutions to this?


Sign in to comment.




1 Answer

Answer by Image Analyst
on 13 Jul 2018

There is nothing wrong with the loop itself. The problem is with this:
('segmentation and counting code')
That code is not robust. Fix that.


Sorry but my camera is not looking at your scene.
I guess it can't be helped. Doing it as a live streaming part is kind of headache one. Thank you for your time!
There's images with and without the car at the third comment which are matlab.mat. Those are my inputs.

Sign in to comment.