# How to detect film area?

**URL:** <https://forum.opencv.org/t/how-to-detect-film-area/2063>\
**Category:** C++\
**Tags:** practical, imgproc\
**Created:** [March 10, 2021, 4:19am UTC](https://forum.opencv.org/t/how-to-detect-film-area/2063 "2021-03-10T04:19:28Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![KoreaKim](https://avatars.discourse-cdn.com/v4/letter/k/51bf81/32.png) [@KoreaKim](https://forum.opencv.org/u/KoreaKim)\
**Post date:** [March 10, 2021, 4:19am UTC](https://forum.opencv.org/t/how-to-detect-film-area/2063/1 "2021-03-10T04:19:28Z")

</div>

![ldr](https://us1.discourse-cdn.com/flex020/uploads/opencv/original/2X/3/312495cfca8cb02c2942e9da08c013bcd01101bd.jpeg)

I want to check the presence or absence of a film

There is a film on the top of the center border

How can I detect it?

Thank you in advance.

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [March 10, 2021, 9:50am UTC](https://forum.opencv.org/t/how-to-detect-film-area/2063/2 "2021-03-10T09:50:46Z")

</div>

welcome.

that picture won’t allow that. the only defining feature I can see is some type of scratches (which may not always be there!) and the edge of the film. otherwise the two areas appear indistinguishable.

this can’t be fixed by magic. it has to be addressed with physical changes.

use lighting for which the film is opaque, or use film that is opaque for the lighting you have.

---

<div class="post-metadata">

**Author:** ![KoreaKim](https://avatars.discourse-cdn.com/v4/letter/k/51bf81/32.png) [@KoreaKim](https://forum.opencv.org/u/KoreaKim)\
**Post date:** [March 10, 2021, 11:57pm UTC](https://forum.opencv.org/t/how-to-detect-film-area/2063/3 "2021-03-10T23:57:08Z")

</div>

The answer is so sad.

Thanks for answering though.

---

<div class="post-metadata">

**Author:** ![Alejandro\_Silvestri](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/alejandro_silvestri/32/357_2.png) [@Alejandro\_Silvestri](https://forum.opencv.org/u/Alejandro_Silvestri)\
**Post date:** [March 15, 2021, 12:40pm UTC](https://forum.opencv.org/t/how-to-detect-film-area/2063/4 "2021-03-15T12:40:36Z")

</div>

@KoreaKim

@crackwitz is right! I can image two approach, none of them is easy.

1. IF you can find a light source that can reveal the film. Some industrial computer vision processes use ultraviolet light, because the specific transparent film glow with that light. Or may be the film can reflect different, so you can search for an specific angle of illumination. This approach needs some research.

2. Train a deep learning classifier. To do this you need to read a lot about this technology, and then build your own training dataset, let say 100+ pictures showing all scenarios and many “no film” images. And, as pointed out early, there’s no magic, there must be something in the image evidencing the presence of the film.

---

<div class="post-metadata">

**Author:** ![Andyrey](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/andyrey/32/317_2.png) [@Andyrey](https://forum.opencv.org/u/Andyrey)\
**Post date:** [March 15, 2021, 4:06pm UTC](https://forum.opencv.org/t/how-to-detect-film-area/2063/5 "2021-03-15T16:06:10Z")

</div>

There is such an optical science as **ellipsometry.** Using 2 polaroids- one on light source, another one on the camera, it gives chance to measure film thickness, or absence/presence. Polarized light will be modulated by intensity due to birefringence effect. I don’t know, is it acceptable in your experiment, or you deal only with post-taken pictures.

---

<div class="post-metadata">

**Author:** ![KoreaKim](https://avatars.discourse-cdn.com/v4/letter/k/51bf81/32.png) [@KoreaKim](https://forum.opencv.org/u/KoreaKim)\
**Post date:** [March 16, 2021, 12:36am UTC](https://forum.opencv.org/t/how-to-detect-film-area/2063/7 "2021-03-16T00:36:15Z")

</div>

I have one questions.

1. Does the ellipsometry Method Use Spectrum?  
 → I only want to use the camera and lights.

I tried using a polarized camera instead of a polarized light.  
but fail…

The film is too thin.

Both are true. - (is it acceptable in your experiment, or you deal only with post-taken pictures.)  
Thanks Andyrey

---

<div class="post-metadata">

**Author:** ![KoreaKim](https://avatars.discourse-cdn.com/v4/letter/k/51bf81/32.png) [@KoreaKim](https://forum.opencv.org/u/KoreaKim)\
**Post date:** [March 16, 2021, 12:40am UTC](https://forum.opencv.org/t/how-to-detect-film-area/2063/8 "2021-03-16T00:40:09Z")

</div>

1.I measured it using the angle of the lighting and the image.

But what I see is random according to the angle.

1. Deep learning is still impossible.  
Too lack of skills.

Thanks Alejandro\_Silvestri

---

<div class="post-metadata">

**Author:** ![Andyrey](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/andyrey/32/317_2.png) [@Andyrey](https://forum.opencv.org/u/Andyrey)\
**Post date:** [March 16, 2021, 6:51am UTC](https://forum.opencv.org/t/how-to-detect-film-area/2063/9 "2021-03-16T06:51:30Z")

</div>

Polaroid filters should be both on light source and camera- only then polarization would play it’s effect.  
But if you deal with given picture as it is, you get the view in ordinary light and can do nothing with it.  
In your image you can try to do with scratches on the film, but is this featured all films? - probably, not…

---

<div class="post-metadata">

**Author:** ![KoreaKim](https://avatars.discourse-cdn.com/v4/letter/k/51bf81/32.png) [@KoreaKim](https://forum.opencv.org/u/KoreaKim)\
**Post date:** [March 16, 2021, 8:13am UTC](https://forum.opencv.org/t/how-to-detect-film-area/2063/10 "2021-03-16T08:13:50Z")

</div>

![scratch](https://us1.discourse-cdn.com/flex020/uploads/opencv/original/2X/8/85366afaa87e859d4391957c1aaea75042f3be3e.png)

The scratch depends on the speed and force at which the film is torn.  
In some cases, scratches are not visible.  
Too many cases.

Do you have a reference or site for ellipsometry measurements?  
I want to test it with correct data.

---

<div class="post-metadata">

**Author:** ![Andyrey](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/andyrey/32/317_2.png) [@Andyrey](https://forum.opencv.org/u/Andyrey)\
**Post date:** [March 16, 2021, 9:43am UTC](https://forum.opencv.org/t/how-to-detect-film-area/2063/11 "2021-03-16T09:43:44Z")

</div>

I interested in ellipsometry many decades ago. You can google it with key words: **thin films  
birefringence polaroids** etc. The word _ellipsometry_ may be redundant, since you are not interested in thickness measurements, only film presence. I remember from my physicist time, that transparent film between two polaroids becomes colorful, it may help you to visualize film area.
