Pages: [1]   Go Down

Author Topic: Check if there any white grease on surface of white part (white background)  (Read 6704 times)

anhnha

  • Newbie
  • *
  • Offline Offline
  • Posts: 12

Hi,
Now I am doing a project about image processing. I want to check if there is any white grease on the
surface of a white part.
My method is to capture the image of part containing white grease and then process the image
to check if there is any white grease.
The problem is that the color of part and grease are almost the same (about 99%).
Therefore, I can't separate them and can't detect the grease.
Could you suggest me some ways/methods to check the white grease on the white part?
Maybe something like what kind of light, how to set up light, etc...
Thanks!
Logged

howardm

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 1984

I'm pretty sure you're supposed to come up w/ your own ideas/solutions to what sounds like a school project.

how about a diffraction grating or simply measuring the amount of reflected light from the substrate whereas grease would change both the spectrum and amount of light reflected vs. an uncontaminated sample.

anhnha

  • Newbie
  • *
  • Offline Offline
  • Posts: 12

Morning,
Thanks for the ideas!
I am not at school any more!
I will study more about diffraction and reflection of grease and part and try that.
With eyes, I can see the grease, it is a little bit shinning.
However, I am afraid about that methods above because the grease is very very thin.
I also use R, G, B light color but they don't help much.
Logged

bill t.

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 3011
    • http://www.unit16.net

If shines, make it shine even more!  A highly collimated bright light coming in at a few degrees divergent from the lens optical axis should do the trick.  Use a long lens.  Should be easy to create a few tens of RGB numbers difference in the highlights.  It sure is easy to see fingerprints on photo prints in those conditions, oh yeah!
Logged

anhnha

  • Newbie
  • *
  • Offline Offline
  • Posts: 12

Hello!

Not sure if I understand you correctly. Sorry I am not a native speaker  of English.
Monday I will capture the image and post it here.

Quote
A highly collimated bright light coming in at a few degrees divergent from the lens optical axis should do the trick.
I
I thought about that. Setting the light at a few degrees but the problem is that the part is large and the grease can appear anywhere on the part.
So, I can't set the light. If we know the grease can only appear at a fixed position then the light setting is not a problem.
Quote
  Use a long lens.
I will consider and try that.

Is this what you meant:

Long lenses also make it easier to blur the background more, even when the depth of field is the same; photographers will sometimes use this effect to defocus the background in an image to "separate" it from the subject. This background blurring is often referred to as bokeh by photographers.
(from wikipedia)

Quote
  Should be easy to create a few tens of RGB numbers difference in the highlights.
Could you rephrase it?

Quote
It sure is easy to see fingerprints on photo prints in those conditions, oh yeah!
You meant fingerprints on grease under conditions such as bright light coming in at a few degrees, long lens?

Logged

degrub

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 1951

Can you put the part on a rotating platform ( like in restaurant ) ? Then have the camera and light mounted together at fixed angle to each other and rotate the part.

Regarding RGB differences between part and grease, i think he means something like 240,240,240 for grease and 220,220,220 for part surface for example.

you could try a "black light" uv source to distinguish between the grease and the part ?

Frank
Logged

anhnha

  • Newbie
  • *
  • Offline Offline
  • Posts: 12

Good night!

Quote
Can you put the part on a rotating platform ( like in restaurant ) ? Then have the camera and light mounted together at fixed angle to each other and rotate the part.
Thanks for the ideas.
Actually, it is not practical here. The part is large and rotating is difficult.
Quote
Regarding RGB differences between part and grease, i think he means something like 240,240,240 for grease and 220,220,220 for part surface for example.
Well, the difference is not that large. It is only several pixels! By the way, the light is not stable and not uniform and sometimes they are identical.
If they are 240 vs 220 then it is not hard to separate them.
Quote
you could try a "black light" uv source to distinguish between the grease and the part ?
I tried that last week but still in vain.
It can't detect grease. However, it detects scratches very well.
« Last Edit: January 17, 2015, 10:46:18 am by anhnha »
Logged

degrub

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 1951

Is this a white lithium based grease ?
Logged

anhnha

  • Newbie
  • *
  • Offline Offline
  • Posts: 12

Quote
Insert Quote
Is this a white lithium based grease ?
Yes, it is lithium white grease.  :)
I thought about some kinds of grease detection sensor but the problem is that the part is very large and grease is very thin.
« Last Edit: January 17, 2015, 11:56:47 am by anhnha »
Logged

kirkt

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 604

How about polarized light?  A thin film may respond well to polarized light or light imaged through a polarizer.

Kirk
« Last Edit: January 17, 2015, 05:04:21 pm by kirkt »
Logged

anhnha

  • Newbie
  • *
  • Offline Offline
  • Posts: 12

Quote
How about polarized light?  A thin film may respond well to polarized light or light imaged through a polarizer.

Morning,
I haven't tried that but could you explain a little how polarized light can help detect grease?
Logged

anhnha

  • Newbie
  • *
  • Offline Offline
  • Posts: 12

Morning and sorry for the late.
Here are pictures of grease with part. It is in the red mark but very very hard to see by eyes.
With some light sources, we can see the grease by eyes as in the images.

http://s10.postimg.org/cvyu4t5rd/IMG_5887.jpg
http://s10.postimg.org/cvyu4t5rd/IMG_5887.jpg
http://s13.postimg.org/554uzc10n/IMG_5922.jpg
http://s13.postimg.org/554uzc10n/IMG_5922.jpg
« Last Edit: January 20, 2015, 05:56:47 pm by anhnha »
Logged

Jack Hogan

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 798
    • Hikes -more than strolls- with my dog

Is the grease typically a different temperature than the underlying piece?  If so perhaps an infra-red modified/sensor may help.

Or going the other way perhaps a UV or other spectrum light source may make it stand out more.  Alternatively lighting it with a coherent light source like a laser.  The previously mentioned polarized light source/detection idea is worth a try, with lighting and detection at various angles.
Logged

kirkt

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 604

It's is not clear exactly what "detection" means in the context of your post (are you simply trying to show the presence of the grease, or are you trying to measure its location and area/perimeter, etc. for example).  Polarized light may respond differently to the grease when compared to the substrate upon which it is smeared. 

Lithium grease is made with a crystalline form of lithium, and many crystalline structures exhibit what is known as "birefringence":

http://en.wikipedia.org/wiki/Birefringence

I have no idea if lithium grease will be birefringent, but if it is you may be able to use this optical phenomenon to isolate the grease from the substrate in an image acquired through polarizer.  A classic example of this phenomenon is the pattern one sees in a car window while wearing polarized sunglasses - you can see the residual stress from the molding process in the window glass due to the birefringent properties of the glass and the polarized light striking your eyes due to your sunglasses.  Take a look at clear plastic parts like forks, spoons, knives, cups, though a polarizer and you will see the same fringes - they are a rainbow pattern correlated with the stress in the birefringent material.  If you bend the plastic, the fringe pattern will change in response to the redistribution of the stress within the material.  You can also change the angle of the polarizer to modulate the appearance of the polarized light.

I don't know, maybe it will do something for you?  Polarizers are cheap and, if you get a few, you can polarize the light emanating from your illumination source and then filter that light with another polarizer mounted to your imager (camera) to control which polarized light makes it to the sensor.

kirk
Logged

anhnha

  • Newbie
  • *
  • Offline Offline
  • Posts: 12

Hello again!  :)
Quote
Is the grease typically a different temperature than the underlying piece?
I haven't take any measurement but I think no. They are maybe at room temperature.
The grease is very thin and I don't think it will have a different temperature.
Quote
If so perhaps an infra-red modified/sensor may help.
Quote
If so perhaps an infra-red modified/sensor may help.

Or going the other way perhaps a UV or other spectrum light source may make it stand out more.  Alternatively lighting it with a coherent light source like a laser.  The previously mentioned polarized light source/detection idea is worth a try, with lighting and detection at various angles.
Yes, I will try that with laser or polarized light.
I tried UV but it doesn't work here.

Logged

anhnha

  • Newbie
  • *
  • Offline Offline
  • Posts: 12

Hello,

Quote
It's is not clear exactly what "detection" means in the context of your post (are you simply trying to show the presence of the grease, or are you trying to measure its location and area/perimeter, etc. for example). 

I want to detect the presence of grease on part with its location.
If there is a way to make it stands out then the camera can take a photo of it and determine its location.
However, the presence of the grease in the image taken by camera is not shown.


Quote
Polarized light may respond differently to the grease when compared to the substrate upon which it is smeared. 

Lithium grease is made with a crystalline form of lithium, and many crystalline structures exhibit what is known as "birefringence":

http://en.wikipedia.org/wiki/Birefringence

I have no idea if lithium grease will be birefringent, but if it is you may be able to use this optical phenomenon to isolate the grease from the substrate in an image acquired through polarizer.  A classic example of this phenomenon is the pattern one sees in a car window while wearing polarized sunglasses - you can see the residual stress from the molding process in the window glass due to the birefringent properties of the glass and the polarized light striking your eyes due to your sunglasses.  Take a look at clear plastic parts like forks, spoons, knives, cups, though a polarizer and you will see the same fringes - they are a rainbow pattern correlated with the stress in the birefringent material.  If you bend the plastic, the fringe pattern will change in response to the redistribution of the stress within the material.  You can also change the angle of the polarizer to modulate the appearance of the polarized light.

I don't know, maybe it will do something for you?  Polarizers are cheap and, if you get a few, you can polarize the light emanating from your illumination source and then filter that light with another polarizer mounted to your imager (camera) to control which polarized light makes it to the sensor.
[/quote
This seems interesting. I will study more about this phenomenon and order some polarizer. Hope to get result soon.
Logged

Bart_van_der_Wolf

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 8914

Hello,

I want to detect the presence of grease on part with its location.
If there is a way to make it stands out then the camera can take a photo of it and determine its location.

Hi,
The camera can only record something if there are differences that show up in the visible spectrum that the sensor is sensitive to.

You say you can see it a bit by eye, so what do you see exactly. So you'll need to ask yourself, what are the characteristics of the grease that are different from the surface it is on. Is there a difference in surface structure or height, is there a difference in reflectance, is there a difference in color, is there any fluorescence?. Whatever it is that make the two different, then try and amplify that difference by lighting, viewing angle (stereo pairs?), postprocessing, etc.

Since we don't know what materials you are looking at, maybe even something like dusting with fine powder (like traditional fingerprint retrieval), or distilled water (with added color dye).

More info is needed for any meaningful suggestions beyond what has already been shared.

Cheers,
Bart
Logged
== If you do what you did, you'll get what you got. ==

anhnha

  • Newbie
  • *
  • Offline Offline
  • Posts: 12

Good night, here.

I am checking the grease in cover of printer. The cover is a plastic and in white color. It is relative large eand I need to check if there is grease and its position (or small region where the grease is located).
Quote
You say you can see it a bit by eye, so what do you see exactly.
By leaning it with some specific angles, I can see it with eyes. It is a bit shining.

Quote
So you'll need to ask yourself, what are the characteristics of the grease that are different from the surface it is on.
Actually, it is very subtle. I can see it is wetter! But if the checking is long after the time the grease is put, they are all dry.
Quote
Is there a difference in surface structure or height
It is a bit higher on the surface but very very hard to know because the grease is very thin. You could see it as in the pictures above.
(sorry, I don't know how to put this in English)
Quote
is there a difference in reflectance
I haven't measure that but because the grease is very thin, does it have some effect?
I tried many LED and UV but they don't work.
Quote
is there a difference in color
I would say no. They are both in white color and very similar.

Quote
is there any fluorescence
With current light setting, no.

Quote
Since we don't know what materials you are looking at, maybe even something like dusting with fine powder (like traditional fingerprint retrieval), or distilled water (with added color dye).

Yes, as I just said above, it is printer cover.
I need to check if there is grease in printer cover.
Logged

kirkt

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 604

Here is a quick, completely MacGyvered, test using some sort of translucent grease (it came with the maintenance kit for the Nodal Ninja pano head - i have no idea if it is lithium-based).  I smeared some of it on my printer cover.  I set up a desk lamp at about a 45° angle to the printer cover, and then set up the camera at the reflected 45° angle, approximately.  I took two shots:

1) with no polarizers
2) with two polarizers - one covering the light, one mounted to the camera lens.  

In image 2, I rotated one polarizer until I got maximum contrast between the grease and the plastic printer cover.

Even if the grease is not birefringent, you can boost the contrast of the glossy film of grease relative to the diffuse surface of the printer and get a pretty good idea where the grease spot is.  You can alter the angle of incidence of the lamp (or camera) to the surface you are inspecting, and change the relative angle between the polarizers to achieve pretty decent contrast.  As the iPhone image shows, you can inspect the piece while viewing in Live View, and you can quickly focus and set exposure as you change the polarization.  This test was performed with a Zeiss 50mm f/2.0 Makro-Planar and 5DIII.

kirk
« Last Edit: January 24, 2015, 01:43:06 pm by kirkt »
Logged

anhnha

  • Newbie
  • *
  • Offline Offline
  • Posts: 12

Hi,
Thank you very much for your time, doing these experiments.
I am preparing to do these tests but the purchase of polarizers and testing instruments here aren't easy and'
take a long time.

From your image:

With no polarizers:
I see the grease is a bit thick but no problem. Actually, I want to check if there is any grease smearing accidentally
on the printer cover. So usually, they are very thin.
Here is the pixel value:

At the center of the grease:

R = 193
G = 188
B = 159

On the printer cover around:

R = 207
G = 201
B = 175

As you can see, there is a difference although they are not in a big gap.
I can use algorithms such as binary to check the grease.
However, the problem is that the R, G, B values vary according to the brigtness of light, the thickness of
the grease,... So the method is not stable.
For example, it can detect grease that is very thick but misdetect where the brightness of light
is low.


With polarizers:
The contrast is better now!
Here is the pixel value:

At the center of the grease:

R = 170
G = 169
B = 140

On the printer cover around:

R = 218
G = 209
B = 180

With this particular stain, I can use binary or something else to detect the grease well.

However, the grease and printer R, G, B values also varies a lot.

With the experiment, the position of grease is known beforehand and so you can setup light, camera,... optimally
to detect it.
But assuming that the grease can appear anywhere on the printer cover, is there a way to set up light, camera optimally
in this case?
My detection method is based on R, G, B values difference between grease and printer cover.
So, if there is a way to make the gap larger, this method wil be stable.

BTW, could you suggest some good polarizers? I don't have any experience about this and I am going to order some to
do the inspection.
Logged
Pages: [1]   Go Up