2

I'm trying to identify the parking spaces after cropping. Here is my code. Can anyone help me. Thanks in advance

 I=imread('carsnew.jpg');
a=63; b=115;
for i=1:10
im=imcrop(I,[a,b,75,133]);
grayImage=rgb2gray(im);
binary=im2bw(grayImage);

figure,imshow(binary);
a=a+85;
end

Uttam Kumar Roy
  • 2,060
  • 4
  • 23
  • 29
Raju
  • 93
  • 8
  • 1
    Show us what you have tried? – Jacques Koekemoer Apr 21 '16 at 06:58
  • I have got each and every parking slot cropped for the provided image but I want to give a unique id to each and every figure and then compare the the empty parking slot and occupied. such that I can know the Number of vacant spaces. – Raju Apr 21 '16 at 08:49
  • Hi, you have as your title that you would like to save cropped images in MATLAB. To do so you can add the following lines to your code as follows: figure,imshow(binary); filename = sprintf('parking_slot_%d.png', i); saveas(gcf, filename, 'png') a=a+85; end Please update your question if you require further assistance. Thanks! – User404 Apr 25 '16 at 06:02

0 Answers0