1. 121
  1.  

  2. 26

    This only goes to show that machine learning should be primarily used when you do not understand the underlying concepts, and use a learning algo to try to discern relationships. Throwing ML at every situation is usually the wrong one, as the author determined.

    When you can see how a process is done (pixel to halftone dots), and you have access to a device (scanner) that can acquire data at 2x the sample rate or more, you can mathematically reverse the operation. And what works best here is an iFFT

    1. 8

      The results really are kinda magic. I’m reminded of the posts from a while ago about blue noise.

      I think you want to lighten the image slightly to make up for the extra black ink added. The after photo is darker than the before.

      1. 1

        Do you happen to have a link to the blue noise article?

        1. 4

          I was thinking of this one http://momentsingraphics.de/BlueNoise.html

          Edit: Also really pretty and nice: http://www.joesfer.com/?p=108

          1. 2

            Thanks! It hasn’t been posted on Lobsters yet. Perhaps you should submit it if you find it interesting?

      2. 6

        Does anyone know if this sort of thing can be automated? There’s an old discussion on adding this to imagemagick, but seems like the conversation ended without a resolution.

        https://legacy.imagemagick.org/discourse-server/viewtopic.php?t=8524

        1. 5

          It definitely can be done the grid pattern seems to be pretty regular. Which actually makes me wonder if the fft image could be easily fft’d again to only remove the 2? 4? dots of the pattern… (Going away to try) The answer is no, the repeated pattern is not as easy to spot as I expected. https://imgur.com/a/4GfUsqy

          1. 7

            So I dunno about 2D FFTs for images, but in the audio world this trick (looking for structure in an FFT using another FFT) is called “cepstral analysis”, and the product is a “cepstrum”, and the secret sauce is to take the log magnitude of the first FFT before applying the second. (Or, if you want it to be invertable, you can take the complex FFT of the complex log of the complex FFT.)

            1. 2

              Do you have the code for this somewhere?

              1. 7

                I used the same app the OP did. Fiji (https://imagej.net/software/fiji/)

                Although Fiji’s version of FFT is slightly different than what other software produces (it’s more pretty though :) ) I didn’t dig into the details for the difference. Edit: I’ve been nerd-sniped and did dig into the difference - you can get the same “prettiness” from gimp’s or imagemagick’s fft by splitting the color levels into pos/neg in the middle and applying logarithm-like color mapping - but you’re losing information that way https://imgur.com/a/GwYjchG Also they wrap the FFT sections differently. Fiji seems to hold the magnitude and phase in different images and shift the quarters around, while gimp keeps everything together.

                1. 1

                  you can get the same “prettiness” from gimp’s or imagemagick’s fft by splitting the color levels into pos/neg in the middle and applying logarithm-like color mapping

                  Interesting. Thanks for the follow up! :)

              2. 1

                the repeated pattern is not as easy to spot as I expected.

                Maybe that’s the bit where we could use ML. /sarcasm

            2. 5

              “You don’t need ML,” Bryan said. “What you need is inverse FFT.”

              This is brilliant.It’s just absolutely rewarding to see something done cleverly and work so well.

              I have to admit, the one CS assignment I did notably badly on in undergrad was implementing an FFT (in C, which was the style at the time), and I never actually understood it, and while we had the applications explained to us, we were never really shown them, so it didn’t sink in for me. The professor was a brilliant and energetic guy who absolutely loved his subject (data structures and algorithms), but maybe got carried away, and overestimated what his undergrads were capable of taking in.