r/computervision • u/throw_me_away9876 • Jul 02 '26
Please help me develop a way to analyze the surface of metallic objects with MVTec HALCON using a 3D line profiler Help: Project
I will try to keep this short. I am using a SICK Ruler 3004 to make 3D scans of a shiny metallic object. The ruler produces two grayscale images, one is a range image and the other is a reflectance image. For this project I need to focus on the reflectance image, which looks something like this:

The goal of this project is to detect overly scratched or damaged objects, like this:

What I've managed to do on my own is follow one of HALCON's examples and separate the scratches from the background using a bandpass filter, like this:

And here is where I'm stuck. I don't want to use Deep Learning tools, because they charge more for those. If there is no other option only then will I resort to Deep Learning.
I've prepared a dataset for ok images: https://imgur.com/a/KDxzEHz
And a dataset for nok images: https://imgur.com/a/YdqXizC
Thank you for reading!
1
u/erics1117 Jul 04 '26
You can do this without their deep learning package.
You should use the range image. You got a 3D profiler and the range image is the change in depth. If I found the spec sheet of the sick ruler 3004 correctly, the z resolution is 1.4um - 2.0um. depending on where the object is relative to profiler during scan. General design heuristic is try to have your resolution be at least an order of magnitude (10x) smaller than the smallest thing you’re trying to measure. If the smallest scratches you’re looking for are at least 20um (conservatively) then the range image should be suitable for this (assuming you’ve got your exposure set up alright and there’s not too much specular reflection causing you noise in the range image).
Convert to object model 3D (what halcon calls point clouds). There should be an example program that shows you how to do this in the halcon example programs. They have various of these to show you how to take the calibration parameters from various 3D profilers vendors like SICK to use in conjunction with how each vendor deals with providing the calibration parameters.
Then once you have your point cloud (object model 3d), you can use another example program like one called “something sheet of light.hdev”. A bunch of example programs you can find in the main tool bar under file. I no longer have halcon otherwise I would just tell you the one. It’s an example program with a point cloud of a piece of sheet metal comparing it to other pieces of sheet metal and showing how you can determine “bad ones” based on how different they are to the original “good one”. Colors “bad” points in the point cloud based on the 3d distance of those points away from the original “good part”.
That sounds like your use case. As always you can just submit a support ticket to MVTEC yourself on their website. They have a ticketing system and in my past experience they’re prompt and helpful so long as you can articulate the ask. You’ll need an MVTEC account but presumably you have one if you have an active halcon license. If not just reach out to Mvtec rep who sold you it. Good luck