Python Forum
Adanced Image Analysis with Python for reflecting surfaces
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Adanced Image Analysis with Python for reflecting surfaces
#1
Hello Everyone
My name is Andrea, a computer engineer graduated many years ago with major in automation. After 5 years as automation software coder I acted as production planning manager for 8 years. Last year I returned to a tech-related job as member of engineering team where I work on innovative projects.
So, I'm quite new to Python having used it only for a few rather simple data science projects of regression/classification/clustering.
I need your help to understand the feasibility of a new project.

It's about gold ingots: the goal is to identify various kind of tamper actions or fakes by comparing high res pictures of the products before they leave the factory and afterwards (in this case the picture is provided by some sort of app designed for final users in the market).
The key identification elements are dies and serial numbers and ingots are of two kinds: casted bars and minted bars. Here are a couple of examples of another company (I cannot name the company which is asking for this project)
[Image: eFPNfWT66EZihaJd8]
[Image: bjjqjonwAvWeYZcD6]

About bars counterfeit actions:
1) big gold bars (100g+) are sometimes bored/milled to extract gold and then the extracted material is replaced by tungsten (similar density) and hole surface is closed with melted gold. Sometimes is not so evident to immediately identify the tamper action but most times it is. In any case by close visual (human eye) inspection, it can be understood.
2) casted or minted bars of any size are sometimes completely "rebuilt" with material mixture of lower purity and same weight, then logo die is pressed upon again (die is "cloned" by fakers) and finally the same serial is stamped. Many times is very hard to tell by visual inspection if bar is a fake or authentic in this case.

Key features of casted bars:
1) obtained by pouring melted gold in stamps. After cooling down, logo is stamped and then serial number is applied.
2) slightly irregular shape/surface, bars are similar but no ingot is perfectly identical to another one, even for the same size and purity
3) bars are not protected in individual cases. Anyway, ingot surface is very reflecting before bars leave factory and then it's very easy to find them full of minor scratches and/or fingerprints once out in the market. In these cases, bars are considered legit obviously.

Key features of minted bars:
1) obtained by mechanical processing of gold (rolling, blanking, annealing, polishing, minting). Minting engraves logo, other data and then serial number is applied with laser.
2) every ingot of the same size and purity is perfectly identical to another ones, apart from serial number
3) bars are protected in individual cases or PVC packaging-certificates. Ingot surface is mirror-like reflecting before they leave factory and even once out in the market as (theoretically) they won't be removed from packaging.

Goals:
- identify boring/milling operations: my idea would be to train a predictor to recognize when bar surface is OK. Drawback: I will have very few samples of milled ingots to train algorithm; how to deal with casted bars with scratches and/or fingerprints?
- identify fake ingots: my idea would be by inspecting die area: here I would compare the die engraved area of factory ingot vs the engraved area of the customer's bar. I can fetch the correct bar with the unique serial number. Is it possible to get enough details to do something like this?

Constraints:
- business requirements #1 is to use a high quality smartphone for the customer QC: it means that pictures of bars in the market will be high quality but not scanner level. In factory acquisition can be done in any way, even with scanner at 1200/2400 DPI, if useful.
- avoid like plague false negative: if customer has still suspicions that piece is fake after it was labeled as authentic by software and by melting it he discovers that purity is not good as declared (i.e. it was fake), this is a huge trouble. False positive is also an issue but can be tolerated to some extent based on situation.

Are my solution ideas feasible with the help of python libraries? A colleague suggested to write here for help as Python should have powerful image processing libraries.
Obviously, I'm open to any idea/suggestion on how to identify and solve any of the problems. My solution proposals might be infeasible or lacking.

Thanks in advance for any tip or lead.
Have a nice day & wonderful year 2021! Smile
Reply
#2
you may find the following of interest: https://www.pyimagesearch.com/2014/09/15...wo-images/

uses Structural Similarity Index (SSIM)
domonkasshu likes this post
Reply
#3
Thank you.
Unfortunately it doesn't work as well as explained with my pictures as surface is very reflecting so that each picture of the same bar with different light condition seems another bar.

Is there a way to apply some kind of post processing to reduce or remove reflection effect?
Reply
#4
Here's an article about using open cv with reflection filter: https://rcvaram.medium.com/glare-removal...355aa2aa52
domonkasshu likes this post
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Upload image to Instagram using python/selenium using image URL failed, need help greenpine 5 5,338 Feb-22-2022, 09:42 PM
Last Post: snippsat
  python audio analysis kiyoshi7 3 1,714 Feb-22-2022, 06:09 PM
Last Post: Axel_Erfurt
  Adding variable to Python code - media sentiment analysis Marietje 3 2,511 May-25-2021, 05:15 PM
Last Post: jefsummers
  How to plot level surfaces schniefen 0 1,621 Nov-19-2020, 07:08 PM
Last Post: schniefen
  PIL Image / python-resize-image AttributeError sallyjc81 1 4,905 Aug-02-2020, 12:06 AM
Last Post: scidam
  Python bug in ArcGIS - Urban Network analysis tool stanimirasn 0 2,212 Jul-29-2018, 06:08 PM
Last Post: stanimirasn

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020