Removing noise from binary iamge
이전 댓글 표시
Hello, there are problems that I faced during extracting the background from the image below. Im using image>background to extract them and change it to a binary image. The binary image shows too much noise that I could not count the number of cars in the image. Is it possible to filter out the image and have only the cars left in the binary image? Could it be the method of extracting the backgrounds are wrong or filtering would work? Thanks in advance.

댓글 수: 7
Probably subtracting the background image from the ones with cars would make it easier to count. I got the attached figure by using the low-res image you provided. With the source images the results would be much better.
Adrian Lim
2018년 7월 8일
Adrian Lim
2018년 7월 8일
Florian Morsch
2018년 7월 9일
If you move the cam a little in between the shots then of course it will affect the result. If you substract the background from the car-image and you have moved the cam for only one mm it can change for example 10 pixel to the left (or right).
This means: your background has a white stripe on the street. In the car-image this white stripe is 10 pixel to the left. If you substract them now you have a significant difference. And thats not only for one pixel but the whole image. If you use that method you should try and get the shots without moving the cam or the object at all.
Also light changes can affect the result. If you have normal light for the background shot and then someone opens a curtain on the other side of the room, even if the light coming in will not directly hit the object it could affect your images. (again, depending on the use its not that much, but it can make a difference, had that exact problem with color detection, as soon as the door was open my color "changed" and was labeled incorrect)
I didn't have much luck with noise-removal. Best I could do for a single image was this.
I2=imread('Frame.jpg');
BW1 = im2bw(I2, 0.1);
BW2 = im2bw(I2, 0.5);
diff=BW1-BW2;
diff(diff<=0)=0;
imshow(~diff)
Which I got simply by playing with the threshold values.
If you use the reference (background) image, then moving the camera will affect the result quite a bit yes. You will probably get the best result if the camera remains steady, but you can also adjust the image for camera displacement quite easily. If you want to use this method, then I suggest you add some reference points (e.g. some bright markers) to your physical models.
Adrian Lim
2018년 7월 9일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Tracking and Motion Estimation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

