Difference between image processing in a loop
1 回表示 (過去 30 日間)
古いコメントを表示
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/191899/image.png)
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/191900/image.png)
The area that it is counting is the road beside the vehicle while doing it in the loop.
bgd=snapshot(cam)
hfig = figure;
while isvalid(hfig)
img = snapshot(cam);
('segmentation and counting code')
end
pause(1)
end
Are there any solutions to this?
0 件のコメント
回答 (1 件)
Image Analyst
2018 年 7 月 13 日
There is nothing wrong with the loop itself. The problem is with this:
('segmentation and counting code')
That code is not robust. Fix that.
8 件のコメント
参考
カテゴリ
Help Center および File Exchange で Image Processing Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!