MATLAB Answers

0

How to remove shadow for ceramic tile?

Asked by Ang Xian Jia on 14 Mar 2019
Latest activity Commented on by Ang Xian Jia on 22 Mar 2019
I'm currently working on image processing for detecting rectangular ceramic tile defect. I'm going to take a picture of perfect tile and also a picture of defect tile, then use subtraction to know the difference between that two picture in order to detect whether there is any corner defect. However, there are always shadow & light illumination in those pictures which cause inaccuracy. Attached below is another two defect tile pictures I had taken previously with iPhone and also Raspberry Pi Camera Module to try on. Main focus is on the picture taken using Raspberry Pi Camera Module. What is the code/step needed to automatically remove the shadow near the edge of the tile every time when a photo is taken? I know that there is a Color Thresholding app in Matlab that can help on this but it needs to be used manually.
Picture A - using iPhone
Picture B - using Raspberry Pi Camera Module
I had try coding using Picture A. Below is the binary image obtained. Notice that the binary image actually included all the shadows near the right edge of the tile, causing inaccuracy. (Most of the code refer to the code made by Image Analyst)
Result obtained for picture A.
For picture B, maybe due to green background use, I can't have a good binary image. However, we can see that the effect of shadow is causing inaccuracy. Im using graythresh and imbinarize function.
Picture B.png
So, how can I solve this? Thank you.

  0 Comments

Sign in to comment.

1 Answer

Answer by Shunichi Kusano on 19 Mar 2019

Hi. As for the picture A, the removal of the shadow is quite difficult, since it is difficult even by eyes.
As for the picture B, analyzing only the red component seems to make the binarization easier. There is a large gap between the background and tile in the red component. Once you decide the threshold, I think you can use it for other pictures, unless you change the environment.
Or, though this is not image processing, can't you use two lights from both sides when taking a photo? That would reduce shadow.
hope this helps.

  1 Comment

Thank you very much for your help! Using two lights from both sides is not working in my case. I have used backlighting as a way to remove the shadow.

Sign in to comment.