- cross-posted to:
- cad
- cross-posted to:
- cad
I’ve managed to do reverse engineering of circuit boards using GIMP and rough alignment of layers using images like the one pictured. I want to use images to reverse engineer parts in CAD, but the minor lens distortion of a camera on a phone at ~20cm high on top of a stack of objects to keep it eyeballed flat is not enough. The result is off in multiple planes. There are minor errors in my curves in the transparent CAD part pictured, but the hole pattern is correct. The picture has been calibrated to 20mm against the ruler. Any suggestions on how to make this usable for replicating the ellipse that crosses the holes ±0.05mm?
+1 for a flatbed scanner. Put a ruler somewhere on the bed for scale. If you use fusion 360, you can add an image to a sketch and scale it to be the correct size. That said, if you’re going for a perfect fit it’s really hard to beat a pair of calipers and things like radius guides unless it’s a super complex shape.
Great call out on lens distortion. Photoshop, along with most other high feature image editors editors, will often have a lens correction option if they have a built in profile for your lens. Darktable is a good FOSS option. You still need to be absolutely parallel to your object though.
The problem is that there is a ridge/groove/ridge structure that is used for a seal and requires accuracy of a spline without constant radius. I can warp and bend anything in GIMP. This would be possible if the image has distortion only on Cartesian planes, but this is fisheye plus minor Cartesian alignment. I don’t think that amount of complexity is reversible.
The scanner idea is probably best, but I don’t have one that is accessible any more. I might try from a distance with some graphing paper.
The scanner will only work if your model is absolutely flat. I spent some time trying to model a baseplate for my camera that I wanted a glove like fit on. In the end I had to iterate a ton. I suspect this was due to
Good luck!
Dark table corrects lens distortion based on the design of the actual lens, not the image itself. The grid it just to check in after the fact. I’m not aware of similar tools in GIMP. It’s trivial in Darktable though, as long as your lens is in the database.
Don’t use a fish-eye lens, it’s lense distortion will be the worst and most difficult to correct. Use a lens with a longer focal length, ideally a prime lens with a fixed focal length. If you maximize focal length and distance to your object as much as is feasible, you will have already flattened the image (minimized lens distortion) a lot. If you use a prime (fixed focal length) lens from a popular brand, Darktable can remove the remaining lens distortion.
You can remove all lens distortion by using a pinhole camera, which has no lens. But that’s probably going to be a tricky setup without an expert.