45
submitted 3 days ago by j4k3@lemmy.world to c/asklemmy@lemmy.world

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?

you are viewing a single comment's thread
view the rest of the comments
[-] oo1@lemmings.world 23 points 3 days ago

Flatbed scanner, or photo with grid paper in background.

Warp it until the gridlines are straight.

I don't know how to do the last part - I suck at photoshop.

[-] IMALlama@lemmy.world 7 points 3 days ago

+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.

[-] j4k3@lemmy.world 3 points 3 days ago

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.

[-] IMALlama@lemmy.world 2 points 3 days ago

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

  • The camera base had a 1mm or so fillet around the edges and the scanner has a very narrow focal plane. This made it hard to precisely place the spline
  • I was probably a bit too obsessive about the tight fit initially and would have been better off starting with a looser one

Good luck!

[-] Wolf314159@startrek.website 2 points 3 days ago

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.

load more comments (2 replies)
this post was submitted on 02 Jan 2025
45 points (97.9% liked)

Ask Lemmy

27342 readers
1906 users here now

A Fediverse community for open-ended, thought provoking questions


Rules: (interactive)


1) Be nice and; have funDoxxing, trolling, sealioning, racism, and toxicity are not welcomed in AskLemmy. Remember what your mother said: if you can't say something nice, don't say anything at all. In addition, the site-wide Lemmy.world terms of service also apply here. Please familiarize yourself with them


2) All posts must end with a '?'This is sort of like Jeopardy. Please phrase all post titles in the form of a proper question ending with ?


3) No spamPlease do not flood the community with nonsense. Actual suspected spammers will be banned on site. No astroturfing.


4) NSFW is okay, within reasonJust remember to tag posts with either a content warning or a [NSFW] tag. Overtly sexual posts are not allowed, please direct them to either !asklemmyafterdark@lemmy.world or !asklemmynsfw@lemmynsfw.com. NSFW comments should be restricted to posts tagged [NSFW].


5) This is not a support community.
It is not a place for 'how do I?', type questions. If you have any questions regarding the site itself or would like to report a community, please direct them to Lemmy.world Support or email info@lemmy.world. For other questions check our partnered communities list, or use the search function.


6) No US Politics.
Please don't post about current US Politics. If you need to do this, try !politicaldiscussion@lemmy.world or !askusa@discuss.online


Reminder: The terms of service apply here too.

Partnered Communities:

Tech Support

No Stupid Questions

You Should Know

Reddit

Jokes

Ask Ouija


Logo design credit goes to: tubbadu


founded 2 years ago
MODERATORS