I am working about smart parking system with video processing and ı need to scan just special area for image processing so imagine a parking area, we need to scan just parking area.So how can we scan special area in matlab with video processing?

조회 수: 2 (최근 30일)
vid=videoinput('winvideo',1,'YUY2_320x240'); set(vid,'FramesPerTrigger',Inf); set(vid,'ReturnedColorspace','rgb') vid.FrameGrabInterval=10; start(vid); while(vid.FramesAcquired<=1000) data=getsnapshot(vid); section1=data(1:100,:,:); section2=data(140:239,:,:); y=zeros(240,320,3); y(1:100,:,:)=section1; y(140:239,:,:)=section2; y=uint8(y);
%% Im=y; rmat=Im(:,:,1); gmat=Im(:,:,2); bmat=Im(:,:,3);
%%Plot the data levelr=0.5; levelg=0.5; levelb=0.5; i1=im2bw(rmat,levelr); i2=im2bw(gmat,levelg); i3=im2bw(bmat,levelb); Isum=(i1&i2&i3);
Icomp=imcomplement(i3); Ifilled=imfill(Icomp,'holes');
se=strel('disk',10); Iopenned=imopen(Ifilled,se);
Iregion=regionprops(Iopenned,'centroid'); [labeled,numObjects]=bwlabel(Iopenned,4); stats=regionprops(labeled,'Eccentricity','Area','BoundingBox'); areas=[stats.Area]; eccentricities=[stats.Eccentricity]; idxOfSkittles=find(eccentricities); statsDefects=stats(idxOfSkittles); imshow(data);
for idx=1:length(idxOfSkittles) h=rectangle('Position',statsDefects(idx).BoundingBox); set(h,'EdgeColor',[.75 0 0]);
end
hold off; end
if idx>10 title('there are',num2str(numObjects),'objects in'); end
hold off; clear all;

채택된 답변

Image Analyst
Image Analyst 2018년 5월 20일
Also post a no-car image plus an image with cars parked some of the spaces.
  댓글 수: 3
Baris Altunhan
Baris Altunhan 2018년 5월 21일
I did search about some thing , but ı could not find any thing, can you help me sir, what am i gonna do in this situation? ı need to scan just some area and ı need to decide empty parking area and ı need to plot green rectangle that is empty area

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by