Posts by s_gruppetta@qoto.org
(DIR) Post #APJDXoXAApoeL8UC3c by s_gruppetta@qoto.org
2022-11-05T21:42:37Z
0 likes, 0 repeats
You can create a 2D sinusoidal grating in #Python using #NumPy and display it using #matplotlib /8
(DIR) Post #APJDXozAUiDXjzaYi0 by s_gruppetta@qoto.org
2022-11-05T21:43:21Z
0 likes, 0 repeats
Or even better, you can use a function of both x and y to make any grating/9
(DIR) Post #APJDXpTefMbVGXquEC by s_gruppetta@qoto.org
2022-11-05T21:44:00Z
0 likes, 0 repeats
You can find the parameters of a sinusoidal grating by using the 2D #FourierTransform.The dots shown contain the amplitude and phase of the grating. Their position from the centre gives the frequency, and their orientation represents the orientation of the grating./10
(DIR) Post #APJDXpxQseQIktmgds by s_gruppetta@qoto.org
2022-11-05T21:44:21Z
0 likes, 0 repeats
Now, if you have lots of gratings superimposed on each other, the #FourierTransform gives you a pair of dots for each of the components/11
(DIR) Post #APJDXqKTUyr3uMZ5Ye by s_gruppetta@qoto.org
2022-11-05T21:45:07Z
0 likes, 0 repeats
Now, here’s the “magical” part of #Fourier theory.Any image is made up of lots of sinusoidal gratings. So, the 2D Fourier Transform of an image gives you thousands of pairs of dots, and each pair represent a sinusoidal grating./12
(DIR) Post #APJDXqnBmDp7LQ01JY by s_gruppetta@qoto.org
2022-11-05T21:45:35Z
0 likes, 0 repeats
And therefore, you can reconstruct the image by adding all of those sinusoidal gratings together.The more gratings you add, the closer the result is to the actual image/13
(DIR) Post #APJDXrCMGdxMbTm7Xs by s_gruppetta@qoto.org
2022-11-05T21:46:06Z
0 likes, 0 repeats
Here's another example/14
(DIR) Post #APJDXrdIeTVVx2NdXU by s_gruppetta@qoto.org
2022-11-05T21:46:35Z
0 likes, 0 repeats
and another one…
(DIR) Post #APJDXs5IyLuPLtU0Bs by s_gruppetta@qoto.org
2022-11-05T21:47:01Z
0 likes, 0 repeats
There's a lot more than can fit in a single thread.If you want to read more detail, and go through the step-by-step writing of the code to decompose & recostruct *any* image, read full article here: #coding #2dfourierimages #2dfouriertransform #fourier /16https://thepythoncodingbook.com/2021/08/30/2d-fourier-transform-in-python-and-fourier-synthesis-of-images/
(DIR) Post #APJDXsTPWjBuYelFlQ by s_gruppetta@qoto.org
2022-11-05T21:48:08Z
0 likes, 0 repeats
So, this thread could serve as my my #introductionI'm Stephen. I used to be a physicist (as you can guess from the thread above) but now I focus on communicating about Python and programming and teaching codingYou can expect more varied content from me, all related to #programming in #Python, from science-y stuff like this, to fun animations using the `turtle` module (no not those boring ones!) and general Python for those learning to code at beginner and intermediate levels
(DIR) Post #APJDXszJc6iC9bgjUe by s_gruppetta@qoto.org
2022-11-05T21:49:10Z
0 likes, 0 repeats
You'll find me easily on Twitter too if you're on there as well. That's a bigger account and get's a lot of interesting conversations going with others in the #Python worldYou can see the sort of things I'm interested it there (until this timeline fills up a bit): https://twitter.com/s_gruppetta_ct
(DIR) Post #APTTgeDSxQfN4MuCUi by s_gruppetta@qoto.org
2022-11-10T22:23:23Z
0 likes, 0 repeats
@trinsec @freemo @peterdrake Also, non-QOTO users will see this as plain text (without the markdown characters) - it would be ideal if they say the markdown rather than plain text
(DIR) Post #APWreayP1a2Oo4IGsy by s_gruppetta@qoto.org
2022-11-12T12:13:12Z
0 likes, 0 repeats
This is a QT (although I suspect only those on qoto server will see it as such?@hynek
(DIR) Post #APWrecL7wZoF2pvvwe by s_gruppetta@qoto.org
2022-11-12T12:40:25Z
0 likes, 0 repeats
@hynek this is what some servers will see for that my last toot
(DIR) Post #APWrecsRwgSqiBWXsu by s_gruppetta@qoto.org
2022-11-12T12:43:50Z
0 likes, 0 repeats
@hynek And that’s the issue, different people see different things.Same with markdown, for example this below is a code block that some servers will see properly rendered, but you’re likely to see just plain textprint("This is a code block")and this is in bold here
(DIR) Post #APWredtYA4wFrt2wEq by s_gruppetta@qoto.org
2022-11-12T12:50:43Z
0 likes, 0 repeats
@hynek so for the toot above, I wrote using back ticks and ** but I suspect you saw neither
(DIR) Post #APWreeht8vCkO0b8hU by s_gruppetta@qoto.org
2022-11-12T13:08:31Z
0 likes, 0 repeats
@hynek if I use plain text mode the symbols stay there but they’re rendered plain text for everyone. If I switch to markdown mode (a feature on qoto), then qoto users see it properly rendered but others see plain text with the markdown symbols stripped out
(DIR) Post #APWrefcbk2ZhDv8R6m by s_gruppetta@qoto.org
2022-11-12T13:26:17Z
0 likes, 0 repeats
@hynek no, I can see the asterisk as plain text
(DIR) Post #APWregXKL9we3pfjW4 by s_gruppetta@qoto.org
2022-11-12T13:28:48Z
0 likes, 0 repeats
@hynek and my earlier toot renders like this on my server
(DIR) Post #APWsks1cdemtNrM75k by s_gruppetta@qoto.org
2022-11-12T13:49:31Z
0 likes, 0 repeats
@freemo @ambv it seems like some can choose (possibly inadvertently) to silo themselves a lot more than others based on choice of servers. Those who silo themselves a lot will of course, by definition, have a skewed sense of what goes on. I’ve not been here long enough to know which servers are which with clarity, but I’m pleased I switched to qoto early on