travisgoodspeed / maskromtool

A CAD tool for extracting bits from Mask ROM photographs.
Other
331 stars 21 forks source link

Adjustable Sample Point Sizes #23

Closed travisgoodspeed closed 1 year ago

travisgoodspeed commented 1 year ago

We currently sample just one pixel for each bit. This is surprisingly effective but some, particularly diffusion ROMs under good focus and magnification, require other sampling methods.

Close this issue when we can adjust the sample size, perhaps with some choices as to how the colors of the sample spot are merged.

travisgoodspeed commented 1 year ago

Example histogram of point samples on a diffusion ROM with poor separation between bit values.

Screenshot 2023-05-07 at 20 58 24

On this particular image, taking the darkest position along a thin horizontal slice would reveal the correct bit.

Screenshot 2023-05-07 at 20 59 52
travisgoodspeed commented 1 year ago

I don't yet have the bimodal distribution that I'm looking for, and sample width is critical, but a quick prototype that samples 10 bits wide successfully identifies many bits that were completely lost in the single-bit sampler. Some, of course, are still wrong, but I hope to correct this with a bit of fine tuning.

Screenshot 2023-05-07 at 22 31 22
travisgoodspeed commented 1 year ago

With the correct width, a proper bimodal distribution appears and all bits can be accurately recognized.

Screenshot 2023-05-07 at 22 39 44

Settings from my photo of the Intel 8271 ROM.

  1. 15 pixel wide sampling.
  2. Darkest of each color channel.
  3. Green is the magic channel. No bimodal distro in other channels.

We probably also want brightest of each channel for darkfield, and we probably want tall samples for when wide ones aren't appropriate. The pixel width will absolutely have to be selectable, and #25 tracks GUI changes that will be needed as we begin sampling more than one pixel per bit.