Hi, how do I save the output to a specific folder?
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Syafiqah Daud
am 2 Aug. 2018
Kommentiert: Syafiqah Daud
am 2 Aug. 2018
Hi, I am trying to save the output of this code but I can't seem to use imsave or imwrite.
I = imread('C:\Users\Student\Desktop\Vehicle number plate recognition\vehicles\vehicle10.jpg');
BW = im2bw(I,0.4);
se = strel('rectangle', [2 20]);
BW_opened = imclose(BW,se);
figure, imshow(BW_opened,[])
s=regionprops(BW_opened,'Area','BoundingBox');
[hh,ii] = sort([s.Area],'descend');
out = imcrop(I,s(ii(2)).BoundingBox);
figure,imshow(out);
out = 'my new image.png'; % Whatever....
fullFileName = fullfile(out, 'C:\Users\Student\Desktop\Vehicle number plate recognition\test images');
imwrite(out, fullFileName);
I would get an error of :| | _Error using imwrite>parse_inputs (line 528) The first argument should not be a character vector.
Error in imwrite (line 418) [data, map, filename, format, paramPairs] = parse_inputs(varargin{:});||
Error in licenseplatecrop (line 13) imwrite(out, fullFileName);_
0 Kommentare
Akzeptierte Antwort
KSSV
am 2 Aug. 2018
I = imread('C:\Users\Student\Desktop\Vehicle number plate recognition\vehicles\vehicle10.jpg');
BW = im2bw(I,0.4);
se = strel('rectangle', [2 20]);
BW_opened = imclose(BW,se);
figure, imshow(BW_opened,[])
s=regionprops(BW_opened,'Area','BoundingBox');
[hh,ii] = sort([s.Area],'descend');
out = imcrop(I,s(ii(2)).BoundingBox);
figure,imshow(out);
out_path = 'C:\Users\Student\Desktop\Vehicle number plate recognition\vehicles'; % Give path here
fullFileName = fullfile(out_path, 'test_image.jpg');
imwrite(out, fullFileName);
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!