Problem regarding image processing in binary image

조회 수: 1 (최근 30일)
Adrian Lim
Adrian Lim 2018년 7월 11일
댓글: KALYAN ACHARJYA 2018년 7월 30일
I'm currently working on image processing on an image on streets. Here are the codes I'm currently using
C=im2double(img);
B=im2double(bgd);
maxchan=max(B,[],3);
threshmax = multithresh(maxchan,4);Qmax=imquantize(maxchan,threshmax);
bw=bwareafilt( Qmax==2,1);
bw=imclose(bw,strel('disk',10));
D=rgb2gray(bw.*(C-B));
thresh=multithresh(D,2);
result=bwareafilt( imquantize(D,thresh)>1, [10,inf]);
result2=imfill(result,'holes')
imshow(result2)
Then, I'll have a result as following
Are there any solutions to get a more complete car-shaped white blob and remove the lines on the road ?? This is because I'm attempting to count the number of the cars. There is another problem where if i take another picture with different lighting or different angle, the result of the image could be worse where i could not see any blobs. The images of the current image are attached as .m files. Thank you in advance. The other pictures where I could not extract anything are also attached.

채택된 답변

Image Analyst
Image Analyst 2018년 7월 11일
I'd use imclose() first to connect some separate blobs, like the car split into two or 3 parts due to a luggage rack on the roof. Then use bwareaopen() or bwareafilt() to get rid of blobs smaller than a certain size.
  댓글 수: 4
Image Analyst
Image Analyst 2018년 7월 11일
편집: Image Analyst 2018년 7월 11일
Your segmentation algorithm is not robust enough. What have you tried? Have you tried the tracking stuff int he Computer Vision System Toolbox? Have you tried using Gaussian Mixture Models? Or even just taking a recent mode image to get the background? Sorry but I can't help you develop a robust turnkey car counting system - that could take months.
and here:
Adrian Lim
Adrian Lim 2018년 7월 11일
I've tried searching for informations and I've looked through those sites. The problem that I am facing is im using images but not videos. I'm using a webcam to snapshot from the model by putting cars on it and trying subtraction method to remove the background and count the cars.

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

추가 답변 (1개)

KALYAN ACHARJYA
KALYAN ACHARJYA 2018년 7월 11일
%% To remove roads
LB=2000;
seg=bwareaopen(result2,LB);
figure, imshow(seg)

카테고리

Help CenterFile Exchange에서 Computer Vision with Simulink에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by