how to load random image from folder
이전 댓글 표시
Hello. I have 4 images in 1 folder and I have to load them randomly. I tried to do this.
>> a=dir(['C:\Users\Desktop\Crossroad\vehicles' '/*.png'])
and then randomly load one of 4 images
im=imread(a(randi(4)).name)
but matlab gives me an error:
Error using imread (line 349)
File "white_car.PNG" does not exist.
It. wrotes that files doesnt exist, but it actually does..Does anyone know how to write it properly? Many thanks.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Get Started with Image Processing Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!