Live data from Hacker News

Moiré no more (2021)

newsletter.shifthappens.site

31–34 of 34 posts

Re: Moiré no more (2021)

#31
Here's my favorite "alternative" explanation of moiré:

sin(a) * sin(b) = 0.5 * (cos(a - b) - cos(a + b))

You may remember this formula from high school. The arguments a and b are basically frequencies. When you multiply two frequencies a and b, you will get their difference cos(a - b) and their sum cos(a + b). If two frequencies are similar (e.g. 101Hz and 100Hz) you get one very low frequency (101Hz - 100Hz = 1Hz) and the other one will be much higher number (101Hz + 100Hz = 201Hz). It's hard to see that higher frequency 201Hz, you have to come really close, but it is easy to see that low frequency, that 1Hz would manifest as 1 dark blob across entire area.

Re: Moiré no more (2021)

#32
post #30

Done since the mid-1960's :) but, nevertheless, always an interesting read! This is classical (as in pre-GPU AI/ML) Image Processing. The reference text book in the field, "Digital Image Processing" by Gonzalez et al, shows how to do it: like the pioneers at JPL's Image Processing Laboratory (est. 1965) denoised Mars pictures from the Mariner probes using Frequency Domain methods like the posted article uses - see an…

It's so classical, it can be done without a digital computer at all, using fourier optics! The true fastest fourier transform, done at the speed of light. https://en.wikipedia.org/wiki/Fourier_optics At the focal plane of a lens, an image is converted into its spatial fourier components. By adding blocking elements at that focal plane (eg. an aperture, or a piece of glass with marker dots), unwanted frequency compone…

Aha - very nice!

My background with Fourier optics is mostly theoretical and the applications numerical.

Any references (books or online) exist about physical applications, like the one you mention?

Re: Moiré no more (2021)

#33
post #5

I wonder what would be the more systematic approach than manually painting over the fft image? That constellation of peaks in fft should be reasonably easy to recognize (semi-)automatically, then you'd need to figure out good mask for those.. is it a circular blob, or maybe diamond/star shape? And what size is best? Etc etc.

Theoretically, you're attempting to remove the artifacts that were added back in by the halftone printing process and recover the original image. If you knew the exact noise spectrum that the halftone print added into the image, you could invert it. For example with some scans of halftone prints of known images, you could reconstruct that noise spectrum and remove it as best as possible. This would preserve, to your best ability, whatever high-frequency data existed in the original image.

If we were sure that the halftone resolution was smaller than the relevant details of the photo, then we could just use a low-pass filter (a circular aperture), removing all the high-frequency components from the halftone print, but keeping the details of the photo. However in this case, the photo has details that are at the same scale as the halftone.

So the next best thing is to try to infer the halftone noise spectrum and subtract it, which is hard because it's mixed in with the photo, and we don't know which spectral peaks are from the photo and which are from the halftone process. What we can guess is that the legitimate high-frequency information in the photo should be pretty random, meaning it will be smeared out across the fourier spectrum, while the halftone print will be strongly periodic - concentrated into dots that are nearly symmetrically distributed around the origin (with some radial pattern that depends on the print process), away from the low-frequency center point.

Based on this we guess that any big dots that are symmetrically placed around the origin are probably more halftone noise than image signal, and any grey areas between them are probably more real image data than noise. Then we fit a noise filter to the dots with a regression, doing our best guess to invert the noise, bringing the whole high-frequency zone to approximately a uniform grey.

And then we hope that the picture isn't a photo of a herd of small spotted leopards.

Re: Moiré no more (2021)

#34
"This is why nobody will allow you to wear stripes on television:"

This used to be cardinal rule in television broadcasting but it's much less a problem nowadays with the increased resolution/line rate of HD TV and video processing (filters) designed to eliminate it.

Nevertheless, whilst once discouraged, moiré was often a useful tool as camera and CCU (Camera Control Unit) operators would use it to focus an image—the more pronounced the moiré the sharper the camera's focus.

As bad as moiré is perceived a much greater cardinal 'sin' in both television broadcasting and photography is lateral inversion. This is where the image has been swapped in the horizontal direction (in some places it was a dismissible offence), as it's a complete distortion/misrepresentation of the image, which in some instances, may go undiscovered—there being no visual clues to indicate the problem.

Lateral inversion is very obvious when writing, street signs etc., appear backwards but for some reason it's very much less so when images of humans are involved. Despite the fact that laterally-inverted images put men's clothes on women and vice versa—as blouses, shitrts, coats and pants flies appear the wrong way around—few people seem to notice.

There's much evidence for this, one I often cite is that there are images from WWII on the US National Archive by the US Army Signal Corps that are still laterally inverted after 70-plus years that no one has bothered to correct (it's not a recent scanning error either as the Signal Corps logo (which is embedded within the photo) is not laterally inverted but the image content is).

BTW, laterally inverting a film image reduces the resolution as the negative or slide is no longer in the normal focus plane.

Post reply on HN