WEBVTT

0:00:00.000 --> 0:00:20.880
<v A>Programming Throwdown Episode 88: Image Processing. Take it away, Patrick.

0:00:20.880 --> 0:00:32.260
<v B>I noticed has become a what do you call hot new trend? Okay, well, it's not really that new. A motif is the Netflixification of everything. Yep, that's my 20-letter word for the.

0:00:32.260 --> 0:00:48.934
<v A>Net? Yeah, I remember when Steam first came out. I said there was no way I'm going to buy a game on Steam where they could, you know, take it away from me. It's just that that seemed like an absolutely insane thing to do. And now, you know, it's just that's all I use. So what a huge change.

0:00:49.424 --> 0:01:18.465
<v B>Well, now it seems like the world and I guess I have one thing in mind we'll talk about here in a second, but the world has changed even more. So one thing is owning digital assets and not trying to get into blockchain discussion, but yeah, things like Steam or Kindle or, you know, but once you sort of buy it, assuming the service stays up, you can continue to use it. And I actually find myself reasonably okay with that. Like I understand the risks are probably not as well understood as we think they are, but I kind of

0:01:18.465 --> 0:01:31.628
<v A>understand it, and things are much, much more stable now than than they were. I mean when Steam first came out, you know, I wasn't confident that it would last, but at this point, you know, I think we could feel safe that Steam will be there in our old age or whatever.

0:01:32.016 --> 0:01:34.665
<v B>Okay, well, you have more confidence than me, but

0:01:34.665 --> 0:01:35.543
<v A>Really? Okay.

0:01:35.897 --> 0:02:06.036
<v B>It's a yeah. Well, so the thing I want to talk about though is sort of the next step that I don't know I've not adjusted to as much, which is the sort of renting of everything. So on Netflix, if I stop paying, I lose everything. And now there's same thing, I guess, both Sony and Microsoft. I think I've tried the Xbox One—what is it called? I don't ever remember. I'm not a big video gamer, so probably not the best person to talk about it, but

0:02:06.036 --> 0:02:09.664
<v A>They have Xbox Gold, I think. Well, you get games that you can rent.

0:02:10.086 --> 0:03:15.260
<v B>Yeah, so the one where you pay is Game Pass or something? Isn't that what it's called? Oh, okay. And you pay a flat monthly fee and then you're able to effectively just—yeah, like Netflix rent, or it even says it's described as Netflix for video games. You can rent as many games as you want; you just play them. Whatever game you want to play, it installs down, but as soon as you stop paying your monthly fee, you just lose all of those. And they can lose access to it, right? So like if their licensing deal goes away, then they can no longer do it. And to me, I don't know, I guess it just depends on the kind of gamer you are. For some people, I'm sure this is a great deal. Like if you're a person who routinely spends more than—let's, I don't remember the exact price, but say it's ten dollars a month—if you routinely spend well in excess of 120 a year on video games, that would not no longer be spent and instead be replaced with this kind of service. Probably makes a lot of sense. But for me, I only play video games which are typically many years old and are less than 20, and I don't buy them, but maybe two or three times a year. Then all of a sudden it's—I'm spending more, but I'm getting a lot more.

0:03:17.012 --> 0:03:56.618
<v A>Yep. I think there's also like a psychological part of this as well, which is you know, think about like a photo album, right? So it's like you take the photos, you put it in the album, and for that moment, you know, you really enjoy it. And then maybe you take it back 20 years from now just to look at it, right? And there are some games like that where you just go back and look at the achievements, like maybe you just go back and play Pac-Man for fun or something. And when you go in that rent mode, you kind of go into it saying, okay, you know this isn't permanent. This achievement isn't permanent because eventually I'm going to stop this service, and it's going to

0:03:56.989 --> 0:05:38.280
<v B>disappear. But now with the future, it seems that the current trend is about to be so—I'm thinking about the Google Stadia announcement. Previously there had been both Microsoft and Sony have said they're going to do it as well. There's been already existing services and pilots to try this. The one I always think about was the OnLive service, which went belly up and then got bought by—I think ultimately Sony for their technology. But this is where instead of having a powerful video game console in your house, you have a cluster farm of powerful video game systems, and then all you're doing is streaming the graphics from those to your house and the controller input to the cloud. The so-called thin client, I guess, is the sort of paradigm, and they're owning things becomes even more tenuous because if I simply bought a game, there's recurring costs of running the servers in the cloud, right? And this becomes this kind of hard arrangement, a weird arrangement. So it almost—if this really is going to be the future, you almost have to go to a purely rental model in my opinion because like you said if you want to just in 20 years decide to play your Pac-Man game, but Pac-Man needed this specialized hardware which is only ever living in a server farm. What are you going to do? Yeah, you need to pay a monthly recurring fee or whatever to have them keep running those servers and keep the lights on. And so that has to sort of be bundled in with the thing. It's exciting but a little trepidation as well because you're sort of subscribing to keep paying this fee, and as soon as you stop—yeah, you don't really have anything. You can't decide to save your budget this month and just play whatever you already have.

0:05:38.280 --> 0:06:26.974
<v A>Yep, I think another really good thing about this though is, you know, the video—the economy of being a video game developer has just been getting worse and worse and worse. Right? Um, you know, think about a video game costs the same price. I mean, I remember I bought Mario 3 for Nintendo; my parents bought it. I was, I don't know, eight years old, and it's something like $60. And now a game costs $60. And you know, think about like zero percent inflation on the price of video games um after, you know, 30 years or something, right? So, so you know, the I don't see how these companies can really stay in business like that. And I think moving to a recurring model, um, you know, might be able to sort of save the industry.

0:06:27.379 --> 0:06:51.038
<v B>I will say the technology of it seems really fascinating. Again, I'm not trying this myself, but everyone reports it works in their opinion pretty well. But that—I, you know, use my controller on Wi-Fi and it goes into the cloud and then it makes decisions based on that input and then sends the video back to me? Like if that if you can really get that working smoothly, that seems crazy. Like, that sounds just insane.

0:06:51.443 --> 0:06:53.180
<v A>It sounds like physically impossible.

0:06:53.180 --> 0:07:19.253
<v B>I mean, I don't—yeah, I've not done sat down and done the physics. I'm not sure maybe for certain kinds of like high-speed reaction video games it is not gonna work. But I mean, people see people have tried and said it looks pretty cool. Like, I've not heard, you know, there always is going to be this risk of, I guess, unpredicted lag where all of a sudden everything just acts really bad. Um, but I mean, you experience that today in online games anyways. Yeah, that.

0:07:19.624 --> 0:07:49.280
<v A>Is a good point, but the difference is with the online games is um they do something called dead reckoning where, you know, you can even see this—you can unplug the your router and the game will still let you walk around as if as if you're you're connected. Um, but just everyone else is frozen. And so even in network games, you might have a lot of lag. It's still your response like the feedback you get for yourself is instant. Um, and so now that's gone.

0:07:50.033 --> 0:07:50.809
<v B>Right. I think.

0:07:50.978 --> 0:08:17.522
<v A>Yeah, the one thing that I think might make this work is if—if the server is actually running like in your ISP. So if you know these companies have a deal with, uh, in our case it's Comcast, but you might be like on Vodafone or Bright House or whatever it is, but you know if all you have to do is reach your ISP and back, um, you know, then I think it can be really low latency, even like maybe 10 milliseconds. Yeah, I.

0:08:17.927 --> 0:08:37.131
<v B>I mean, I guess we'll see, but there's more been more and more announcements. Everybody is at least—it sounds like all the major players are at least going to make an attempt at doing this. Um, we'll see what happens. I mean, what happens? All the TV manufacturers made a pass at making 3D TVs, and I was thinking about the other day, you know, I don't even know can you buy a 3D TV anymore? Yeah.

0:08:37.131 --> 0:08:47.440
<v A>I remember that was a big deal. You know, I think 3D TVs died relatively recently because I remember about a year ago that was still a thing and now they're just completely gone.

0:08:47.644 --> 0:08:52.369
<v B>I mean, I know you can do 4K TVs like that's pretty standard now. Yeah, that's

0:08:52.369 --> 0:08:55.964
<v A>I mean, that's just a straight upgrade. So so that's yeah. So

0:08:55.964 --> 0:08:58.748
<v B>Yeah, so okay. So now 3D TVs, so but

0:08:59.288 --> 0:09:01.400
<v A>Yeah, I think 3D TVs is DOA.

0:09:01.904 --> 0:09:04.519
<v B>Should we have a moment of silence? Yeah, people.

0:09:04.705 --> 0:09:16.920
<v A>Oh, have you tried getting on a tangent here, but have you tried the self-contained VR like the Oculus Go? Yes, or I think there's one from Google?

0:09:16.920 --> 0:09:24.482
<v B>Yes, I have tried the Oculus Go. I got it as a Christmas gift combined in with the rest of my family for our father, you know.

0:09:24.482 --> 0:10:15.479
<v A>The only thing I don't like about the Go is it doesn't have translation, which is actually the most important thing. So it's like, you know, so just to explain what that means: like you could turn your head from side to side and it makes sense, like it feels natural. But if you take a step forward, the system doesn't know you did that, and so nothing will happen. But it's very close. I mean, if I don't know anything about this kind of physics or how this would work, but if they could make it so that somehow it's a self-contained system—maybe there's antennas sticking out or something—but it would track your movement as well, that would be really cool because like you could let's say map your house and then you could run around your house playing laser tag or something wild, right?

0:10:15.563 --> 0:10:44.280
<v B>Well, that's the I think the HoloLens, the new HoloLens demos I've seen, and the Magic Leap work like that where you're still tethered. But yeah, there's not like if I recall Craig, I don't think there's an external camera. There's sort of cameras on the goggles, and your first step is to look around the room so that the cameras can figure out sort of the pose and your position, you know, from looking at the room and identifying features.

0:10:44.280 --> 0:10:51.304
<v A>That makes sense. I think that would be really fun. Maybe a little dangerous, like you fall over the couch or something, but it could be.

0:10:51.304 --> 0:10:59.168
<v B>Really fun. Well, those two are augmented reality, or well, I always mess up the names. There's augmented reality and then what's the other one? Virtual reality. Oh oh.

0:10:59.607 --> 0:11:00.720
<v A>I see.

0:11:01.125 --> 0:11:03.015
<v B>Yes, and then there's also virtual.

0:11:03.437 --> 0:11:09.749
<v A>Reality. Yeah, I haven't actually tried anything other than just pure virtual reality where you know you're on the moon or something.

0:11:09.900 --> 0:11:40.191
<v B>So wait, so bringing up the—so your tangent back to the original topic is anyone talking about moving the Oculus Go? It doesn't plug into your computer, which to me is a huge difference. That one it's a lot cheaper than a computer rig plus the VR goggles. And the second thing, like it doesn't plug into the computer, but I guess that obviously limits the current graphics capabilities and stuff. But yeah, has anyone talked about like thin client VR or is there any lag? I imagine is just makes that kind of horrendous.

0:11:40.495 --> 0:12:15.240
<v A>I don't know, to be honest. I mean, well, so one thing—the one thing I've been wondering is, you know, I wonder if if the thin client is maybe too extreme, but there could be some middle ground there, right? So for example, something could maybe pre-render parts of the image and get that down to you within, you know, 20 or 30 milliseconds. All you have to do is just that one rotation. So basically, you get all the geometry; the only thing the client has to do is um handle the player movement, you know, in the very short term, and everything else could be done.

0:12:15.645 --> 0:12:22.480
<v B>Off-site interesting. So yeah, it's like if you can just distort roughly, like distort the image—I don't know how that for the couple meters of movement. Yeah, yeah, but

0:12:23.509 --> 0:12:30.597
<v A>Yeah, that's some really cool stuff coming down the pipe. All right, time to news. So I think I

0:12:30.867 --> 0:14:30.620
<v B>Got the first article. This is a kind of interactive game for explaining multi-threading issues. I played the first couple levels and I passed them. Woo, nice! That's hard, but a series of tutorials kind of going through various issues with deadlocks and multi-threading problems. And when I sort of saw the article come across like, oh what? How would you even—and I just expected if you've ever done these like capture the flag style competitions or online things, these puzzles that you know, you're like download something runs. I thought it was gonna be a fairly complicated setup, but I was pleasantly surprised. I actually had a and again, I haven't done more than the first couple levels. They had a pretty good way of going through it where you have sort of side-by-side view of two sets of code, and a thread running on each, and sort of, you know, how would you step the pieces of code in such a way to cause a problem to occur? And it is sort of trying to teach you a little bit about how to do it. And so you could have a critical section or a lock or a Mutex, and you know stepping the one getting to it, getting to the other, and understanding that some instructions actually are sort of multiple instructions in reality. So if I say, you know, in C++, you might say counter++. But counter++ is sort of actually two instructions. It's first, you know, get the value of the counter, then add one to that value, and then write it back. And so it's actually not a single atomic operation. And so understanding that and expressing that this sort of goes through it, and I thought, wow, actually I wish I would have had this before. And so you know, thinking through that having these counters—I hopefully, I, you know, I'm gonna actually go do some more of it afterwards because now that I actually sat down and tried it, I kind of interested to see how far I can get and how hard it becomes because it seems a little bit.

0:14:30.620 --> 0:14:49.174
<v B>And we've recommended those games before, but the video games like what is that most recent Human Resources was one. Yeah, and there's others where you're like doing sorts of programming tasks, and they seem really easy at first, but then it's like, oh man, this is just like my day job only with a very weird programming language. Yeah, that's

0:14:49.360 --> 0:14:53.072
<v A>The only game where I've actually gotten all the achievements. Oh.

0:14:53.072 --> 0:14:54.017
<v B>Really? Yeah.

0:14:54.017 --> 0:15:13.778
<v A>The last achievement is so hard. There's one where you have to—you have to build a sorter, but the rules are so tight. I ended up—I think I had to unroll a for loop or even it's worse than that; you have to unroll part of a for loop. But it was a lot of fun. I highly recommend that game Human Resource, I think.

0:15:14.588 --> 0:15:17.490
<v B>We talked about once before, but if yeah, always worth talking about it again.

0:15:17.490 --> 0:15:18.115
<v A>We've mentioned it.

0:15:18.115 --> 0:15:25.354
<v B>Um, yeah. Yeah. I'm not an achievement kind of guy, so I rarely—I don't think I've ever gotten me too. Yeah, it's

0:15:25.354 --> 0:15:32.060
<v A>The only time—only time I've even paid attention to the achievements, let alone got all of them, but it was a very, very satisfying game.

0:15:32.060 --> 0:15:49.874
<v B>But anyway, so yeah, check this out. So I not said what it is. This is a—it's called Deadlock Empire. My guess is it's probably searchable by that term. Oh, here I can try 'Deadlock Empire.' But it's on GitHub, and yep, if you search 'Deadlock Empire,' it'll show up. Cool. And then of course, it'll be in the show notes, so the game.

0:15:49.874 --> 0:15:55.037
<v A>is actually hosted on GitHub, so it's like JavaScript or something, or it's a—you download an? No, no, there's—

0:15:55.037 --> 0:16:16.671
<v B>no, there's no download. It's just on—it's just a web, a web thing. Yeah, sorry poor explanation. Yeah, that makes when I explained—when I expressed it to Human Resources, I definitely lost the context there. Um, yeah, so it's hosted on GitHub. It's a series of web pages. I don't know the exact technological magic that they did to make that. Yeah.

0:16:16.857 --> 0:18:14.720
<v A>That's—that's uh yeah, it's got to be, yeah, probably some JavaScript engine or something. All right, my news is the Godfathers of AI win Turing Awards. This is pretty cool. Um, a little bit of backstory here. Um so there was a time, believe it or not, where um neural networks were really, really shunned. So neural networks actually went through—we call the AI Winter. And there's actually two AI Winters. Um but basically people just kind of really hyped them up and then they just failed to deliver twice. Um both times there were some—some you know pretty serious limitations. And and uh it gets, you know, technical pretty quick, but basically, you know, people who had really good reasoning said, 'You know, we need to be doing everything with neural nets.' When you do image processing with neural nets, uh you know translation can be done with neural nets, etc., etc. And I was actually one of those people. Um I came into it much later, but my advisor—I guess I should say—was really one of those people, uh saying everything needs to be with neural nets. They're so powerful. Um But you know, after years and years of them not delivering, people just gave up, which is—which is very natural. Um But not everyone gave up. And so um you know Sammy Benji, oh, Yan LeCun, and I think Jeff Hinton are the three people although there's others. Um You know they uh continue to advance the state-of-the-art neural nets and they finally got that technology kind of off the ground. Um And part of that was a rebranding. They—they switched it from saying 'neural nets' to 'deep learning,' um which really just served as a way for people to try them again and not be bogged down with all of the baggage of all the failures of the past. Um But under the hood, there's also some technological advances and things like that. Um And so these

0:18:14.720 --> 0:18:39.500
<v A>folks won a Turing Award for people who don't know what a Turing Award is. The most prestigious, um you know, computer science award is basically the Nobel Prize of Computer Science. Um it's just very well deserved. And uh you know, honestly, I never thought I would see—I would see something like that. Um but uh I think it's amazing how far the technology has come. It's really cool. Congratulations. Yeah, totally.

0:18:39.500 --> 0:18:47.669
<v B>Um, breaking news. I just saw—clicking through this article that Valve just announced they're making their own VR headset called the Valve.

0:18:47.854 --> 0:18:52.300
<v A>Oh man, I'm not surprised because they have the SteamVR already. So—

0:18:52.300 --> 0:18:55.639
<v B>it won't be breaking news by the time the episode comes out, but it's breaking news right now.

0:18:56.882 --> 0:19:28.152
<v A>Release all the episodes. People who are watching the show live—so by the way, if you're on our Discord, um I make a little announcement before we go live. Um if you're on Discord, it sends a little push notification to your phone. Um obviously there's a bit of serendipity there. Um you might be asleep or you might not be available to just jump on Discord at that moment, but some people are. And so if if you can watch the show live, then you can find out about this right as it happens. Yeah.

0:19:28.979 --> 0:20:01.580
<v B>Uh, so my next article news—it's neither of those. Is a little device I came across reading, I think some Reddit threads called the O-Droid Go and the O-Droid Go. Okay, I think we've talked about using a Raspberry Pi for doing emulators before, um and actually came across it in that context that um you know hey, there's this thing that looks vaguely like Game Boy. Um it's like a nondescript pocket console. Um Oh yeah.

0:20:01.580 --> 0:20:02.610
<v A>I see it now.

0:20:03.049 --> 0:22:00.904
<v B>Uh and um you build it up from a kit. I think it's like 40 or 50 US dollars. It looked like there was some on eBay, um like with all these things. It's always sometimes a little bit hard to find out exactly how you would acquire them. And it has O-Droid in it, which I'm not exactly sure. Yeah, I don't know what that is. Places and it has like a sort of Android logo, but I don't think it has anything to do with Android. Um But what it does, go, does allow you to do is it is an emulator, and I guess that's cool, you know, having played with that, you know be legal. But you know um emulators and the thing that I saw it for is that the chip on it—I had come across before—is this chip called the ESP32, which is an ARM core 32-bit processor, but it's famous for being like a really cheap Wi-Fi device. And I don't know if they have the Wi-Fi ability in here. I assume they do. But what they have for it is the Arduino IDE, so you're able to use the Arduino IDE and the Arduino libraries which sort of act as kind of like a wrapper around a lot of pretty difficult things to do normally with embedded programming. And what I got sort of interested in was with this hardware and a screen and the thing that always takes so long figuring out how to sort of hook all that together, with example code—this becomes, 'What if?' You've heard Jason and I on many episodes in the past. We've talked about how we got into programming, and a lot of it involves—and this is common with a lot of people I work with: programming on the calculator, programming in QBasic or some form of BASIC where there was like a put pixel and making some form of graphical interactive—you want to call it a game? Maybe it was a game? Maybe just a little sort of playing with cool yeah procedural graphics simulations. Yeah, exactly. Um and here's a device that is, you know, but I don't think people can do that anymore because you can't from your—from your phone really do that. You hooking up your phone and getting the whole—you know.

0:22:01.073 --> 0:23:06.970
<v B>Android development environment or XCO is actually a very sort of large task, like even to do relatively simple things. But here definitely I think this—if I if I had to look across this seems pretty close to how I felt about developing sort of little interactive games on my calculator, um where there's just really simple low-level ways of just writing out text and you have, you know, just the sort of Game Boy style buttons. And the kind of good thing here it looks like, you know, I don't have one myself yet. Um I'm thinking about getting one to try it out, but it looks like there's enough examples. So for instance, they've implemented Flappy Bird in the Arduino stuff, and that feels like something you could go in and modify and sort of have enough starting there where you could get going without worrying about, you know, the tons and tons of overhead setup. Um if you have a cell phone, I think you can do that too. I feel for me almost this is one of those things—I'm not an artist, but you hear artists talk about that sometimes: creativity comes from the sort of restrictions what you don't have. The more freedom you have, it almost becomes pretty difficult. It's a

0:23:06.970 --> 0:23:09.704
<v A>Focus every restriction is some type of focus. Yeah.

0:23:09.980 --> 0:23:35.792
<v B>And so I feel this is restrictive enough environment whereas like a phone you might be tempted to try to do something sort of insane with multiplayer gaming or and it's just like here it's like, look, this is ridiculous. You're not going to do that. And so by that you're limiting what you are able to do, and I think it would be a pretty cool thing because I know for me looking back at how I got started and other people, I think having access to something like this would have been like amazing. Um yeah.

0:23:36.130 --> 0:24:07.990
<v A>Totally. So I looked it up, and the Odroid is—it looks like a competitor Raspberry Pi. Okay? So it's basically it's running, you know, ARM processor. It looks like it supports Arduino and all of that. But it's it's way heavier weight than Arduino. It's like four gigs of RAM. Yeah, it's basically the specs of a Raspberry Pi, but with—but with, you know, sort of like an ARM actually, yeah, yeah, an ARM instead of a instead of an i386. Also, the Odroid has looks like it has much better GPU than the Raspberry Pi, but

0:24:08.560 --> 0:24:32.273
<v B>Yeah, I mean so running Linux on doing something. Yeah, maybe, but I don't think to me this Odroid Go one, you know, they're showing here examples with in MicroPython where you can blink the LEDs and put text onto the screen that's included and bundled with it. Here's a way to like—yeah, oh, here have an access point server where you could, you know, basically go to the device and toggle an LED on the device from your computer. I mean, this seems like pretty

0:24:32.644 --> 0:24:33.657
<v A>Cool stuff. Yeah, totally.

0:24:33.859 --> 0:24:35.800
<v B>Pretty easy way to get started.

0:24:35.952 --> 0:26:26.196
<v A>That is awesome. Yeah, it's not too expensive either. The base model is about looks like $49, so it's not too bad. Um you know, I mean worst case if you're tinkering out there, you fry it—you're not losing hundreds and hundreds of dollars. So all right, my news is this actually blew my mind, and I feel like, you know, I know a lot about terminal programming. I wrote Eternal Terminal. So I—I don't so it's just I don't think I know everything, but I know a lot about terminals and how they work, and this completely blew my mind. So there's there's something called Sixel—S-i-x-e-l—and those are ANSI codes you can type in to draw images on the terminal. So like right now on your terminal, you could just draw a picture of a cat. Um that that blew my mind. Like I mean just the idea of just being able to just draw a picture. I mean, like it just shocks me actually that um you're just more console apps don't do that. Like why why don't console apps uh just draw pictures, you know, instead of instead of doing ASCII art? Right? Um it is very cumbersome and kind of weird looking. So that's that's probably part of it. I mean by weird looking, I mean the API um but this uh GitHub repo is pretty cool. It's Gnuplot through Sixel. So Gnuplot is a open source library for generating, you know, plots. You could plot line graphs, bar graphs, pie charts, etc., etc. Um and now you can literally just run this command and you get like a bar chart in your terminal. So not like, you know, a bunch of pipes that look like a bar chart; you get a picture of a bar chart, which is which is really cool. Um so I haven't tried it yet. I'm gonna probably try it tonight. Um but uh if it works, that's uh that's pretty amazing. Yeah.

0:26:26.584 --> 0:26:30.803
<v B>No, I'm like wanting to try this like where you're done. Yeah, isn't that?

0:26:30.803 --> 0:26:58.967
<v A>Mind-boggling. Like how did we not know this? It's just like you just have to type a bunch of weird black magic characters, and I'm sure not every terminal supports it, but I would bet, you know, most of the common terminals do because, you know, this technology even this as foreign as it as it sounds, I'm sure it's been around forever. And uh yeah, you just type these characters in a certain order and you end up with like, you know, a purple dot right on the terminal. It's pretty wild.

0:26:59.946 --> 0:27:02.646
<v B>Cool. It's time for Book of the

0:27:03.355 --> 0:29:02.580
<v A>Show. Book of the Show. My book of the show is Influence: The Psychology of Persuasion. So um someone recommended—actually a different book about persuasion which I just finished reading. Um that book was okay, but even that book the author suggested getting this book, and this book seems to be seems to be like the gold standard of understanding persuasion. My guess is this one's going to be a little bit or actually a lot more in depth. It's definitely longer than the book I read. Um so I figured I'd go straight to recommending the good thing. Why would I make everyone else have to read two books? So um I found the the first book I read just really, really fascinating. Um it's also kind of weird. I mean just persuasion in general. So well, one thing is is uh the listener, you folks at home don't have to worry. Uh I'm not persuasive at all. So so reading this book made me realize I have zero persuasion skills. I'm not actually, uh, you know subconsciously controlling controlling anything. I'm sure everyone was surprised to hear that, but but the uh uh you know I realize it's a profound skill and it's also kind of weird to think. Okay, maybe this person let's use car salesman for example. So like this person doesn't want to buy a car, and maybe they shouldn't buy a car, but you could, you know, talk to them and convince them to buy a car, and now they have a car that maybe they didn't need. It's just kind of weird. Um so I think it's one of these things that you have to—I guess like anything you have to, you know, use your code of ethics and use it sparingly, but it's it's kind of like a weapon that I didn't really realize that people had. Um But it talks about, you know, how to speak persuasively, how to um you know convince people, and there's different scenarios. There's scenarios where, you know,

0:29:02.580 --> 0:30:57.740
<v A>Somebody is completely against your position. How do you sort of start with some common ground and build that up? Um, there's scenarios where somebody um wants someone—basically wants something, but maybe not enough. So maybe the person wants to buy a car, and you're a car salesman, and you need to get them across the finish line. A whole bunch of different scenarios. I mean, some of them didn't really apply to me. There's like dating scenarios, and just those days are over. Um things like selling things that probably never will happen, but they're also, you know, how to give persuasive presentations. They also go over a variety of—there's a lot of historical anecdotes. So there's one thing in particular—was I guess this idea that, you know, there are some stories that are kind of told and told and told, like Aesop's Fables, uh, you know the Bible, or even just—I mean, you know a lot of these like texts have a lot of the same stories in them, right? Um and so there are some stories that either everyone knows or enough people know. And it's kind of like the idea behind the story has then spread, and so it's sort of like a subconscious thing. There's people who don't even know they know, but if you kind of have these certain undertones when you speak and when you write, you can kind of tap into some of these—some of these motifs. And sort of like the analogy was it's kind of like when you're riding a current or riding a wave. So you could—you know, you could just paddle by yourself, but or you could ride this wave of this sort of narrative that's been going for thousands of years, and you could use that momentum. I thought the whole thing was super interesting. Super shout out to—I don't know if I should mention his name, but A.

0:30:57.740 --> 0:31:05.646
<v A>Co-worker of mine who recommended that I read these books on persuasion. He had read them and he thought they were really good.

0:31:05.646 --> 0:31:09.207
<v B>Well, that's why you ended up reading them because he had already read them and he persuaded. Oh.

0:31:09.207 --> 0:31:15.062
<v A>Man, he persuaded me! Oh, I feel so cheated. He—I wonder if he got a cut or something. Did you?

0:31:15.585 --> 0:31:17.054
<v B>Click on a link he sent.

0:31:17.982 --> 0:31:30.891
<v A>You in chat? This was in person. Okay, in person he persuaded me, and I'm pretty sure I bought that book either right while we were standing there or the next day. That's how good he is. Um, that's how good this book is. So, so.

0:31:30.975 --> 0:31:35.785
<v B>If Jason has persuaded you to also go read this book, let him know. That's right. So,

0:31:35.785 --> 0:31:46.280
<v A>If I persuaded you, um, you can go to Audible. We'll plug it right now: audibletrial.com/programmingthrowdown, and pick up a copy of this book for free.

0:31:46.280 --> 0:32:27.675
<v B>Well, same for my book. I will attempt to persuade you that if you would like to not learn about persuasion but instead learn about a world where magic and guns mix. Um, my book is The Promise of Blood by the book one of the Powder Mage Trilogy, which is—which is a trilogy, I confirmed because I've messed this up. Uh, the trilogy is complete and out, so also checked on that. So, I really trying to get my ducks in a row because I've not always done so well and kind of knowing how many books are in the various series that I'm reading. I mean, it's

0:32:27.675 --> 0:32:29.937
<v A>hard. You might not even know every time.

0:32:30.072 --> 0:33:28.257
<v B>And this book—I am listening to it. Oh, I did finish listening to it. It's 19 hours long. Um, and like I said, this is a book where there are actually several kinds of magic, several—I don't even call them; they're not called wizards. There's several different sort of whole forms of magic, and different people have access to kind of one of the forms of magic, and they're able to do various things. Um, and there's this book, you know, some books jump in and try to explain everything that's happened in the world and get into it. This one sort of just jumps into the middle of things, and for a while you're kind of just left trying to figure out what the various things they're talking about are. Um, but I thought it was an interesting departure. I haven't read a book in a while. The other one I've recommended, The Lightbringer series, also has um guns in it. Um, but it's—it's kind of an unusual thing you don't often see sort of both magic and guns. And so, so is it.

0:33:28.257 --> 0:33:39.040
<v A>It is? It just guns or is it—is it more broad like there's—there's, you know, is it like Steampunk plus magic kind of? Yeah? Or is it just like total medieval fantasy? No?

0:33:39.040 --> 0:34:07.000
<v B>No, no, definitely kind of like I would say yeah. Like steampunk magic—that's a good call. Yeah, okay. So there are some references to steam engines, but people don't go; they're still riding around in carriages, so it's not like medieval per se. Yeah, right? And this one is interesting because not only does it kind of have just guns in it, but actually gunpowder itself is used in sort of kind some of the kinds of magic, like it's a kind of magical substance. But as far as I

0:34:07.103 --> 0:34:10.124
<v A>hear? It reminds me of Full Metal Alchemist. Oh.

0:34:10.309 --> 0:34:16.380
<v B>I have not. Oh, maybe it is. Maybe it's like—maybe they just lifted that as an idea. I don't know. I don't know what Full Metal Alchemist is.

0:34:16.755 --> 0:34:19.995
<v A>I'm sure. I'm sure that that trope has been around, but yeah, that's cool, but

0:34:20.350 --> 0:34:36.027
<v B>Yeah, I thought it was pretty interesting again. I—you know, I don't want to spoil so much of the plot, but it wasn't—I personally didn't find this an especially deep read or a particularly—this sounds really dumb—a realistic magic system, like sometimes when no, I mean one

0:34:36.027 --> 0:34:42.372
<v A>that like fits Newtonian law in a sense, like you shoot ice and then ice could turn into water or something. Oh, sure.

0:34:42.372 --> 0:34:53.712
<v B>Yeah, that'd be a good example. Yeah, like—oh, I make magic ice and therefore it doesn't melt, and it's like, oh, come on now. Yeah, that's but not referencing any Disney movies. Um the the

0:34:53.712 --> 0:34:54.539
<v A>Yeah, I.

0:34:54.539 --> 0:35:32.260
<v B>Guess like you said it's like—it kind of has like what seems to be a little bit plausible. Um but yeah, I found this one to be good and interesting, but to me some magic systems are explored in the sort of socio-economic impact that it would have. Like, oh, if you had this skill, you know, you would enter into this kind of trade or you know you would be desired because you'd be really good at these kinds of tasks. So like in a world where there were magicians who could remove friction between two objects, like you would never use oils or bearings if that magic was common because you would just have magicians decrease the

0:35:32.260 --> 0:35:34.752
<v A>friction of the thing you need. Um yeah, I'm not

0:35:34.752 --> 0:35:49.146
<v B>that's in this. I'm just making up an imagine example. It's like, oh, okay, this is sort of a—I would consider that kind of like a realistic or a you know kind of hard magic, but where you're trying to kind of really think through the implications of everything, not just have like a good story where there's magic. Yeah, it's

0:35:49.517 --> 0:36:06.207
<v A>kind of like in, you know, The Final Fantasy video games, it was always interesting how, you know, everyone has access to a life spell, but then the major characters will die as part of the plot. And it's kind of like—kind of like you really have to suspend disbelief to, you know, absorb that. Oh.

0:36:06.274 --> 0:36:09.025
<v B>I never thought about that. Wow, you're right. Yeah, it's

0:36:09.497 --> 0:36:10.442
<v A>Just like why don't

0:36:10.442 --> 0:36:16.264
<v B>They can die in battle, but then like you could bring them back. But then like they could die outside of a battle and you can't bring them.

0:36:16.585 --> 0:36:30.560
<v A>back yeah there was actually one final fantasy game i think it was final fantasy three where um somebody dies and the person casts life and then life two life three and re-raise and none of them work and i thought okay well

0:36:31.030 --> 0:36:33.207
<v B>That's at least an homage to this. This.

0:36:33.308 --> 0:38:15.790
<v A>Cool. All right. If we didn't persuade you to buy our books, you can still help us out by joining our Patreon and being a patron. You get a super fast RSS feed. The downloads are much better. And also, we—you know, kind of take that money and we figure out ways to get more people to listen to the show. You know, which helps them out. I actually talked to there's a person who just happened to be in the Bay Area, and they reached out to me and they said, 'Hey, you know, did you want to meet up?' I said sure. I said, 'You know.' So we ended up meeting up, and I had a really great conversation. And it was—it was actually just really touching that you know this person was not a CS major or anything like that, completely different discipline, still in the sciences, but you know a totally different science. And you know they they're listening, you know, they were kind of what's the word? They're dabbling in different, you know, fields. They're doing contract work and things like that. But after they listened to our podcast, they realized that that really what they want to do is is programming, and so they kind of taught themselves. I don't know exactly; I should have asked what sort of, you know, lessons they took and things like that. But but they taught themselves from scratch, and now they're working at a tech company, and they—they you know said a lot of it was because of our podcast, which is which is awesome. So we're gonna try and reach as many people as possible, and and that the patron patronage helps us do that. So I appreciate it. All right. Well, moving on.

0:38:17.410 --> 0:38:19.040
<v B>To tool of the show.

0:38:19.604 --> 0:40:19.200
<v A>Tool of the show? I have two tools of the show. Hey, that's cheating. These are pretty geeky. One is called PuLP, and the other is called PyBnB. So PuLP is—actually, I don't know what the U is, but it's Python linear programming. And PyBnB is Python branch and bound. And so I'll explain what these are. They're pretty cool. So there's a lot of problems where it's kind of like solving a maze, right? So you start one—you start at the beginning of the maze, and you just kind of there's not like a formula to solve a maze; you just have to kind of try it, right? So you have to just, you know, you could imagine even if you do this in one of those placemats they give you at a restaurant or something. You're just kind of drawing the maze that you kind of get stuck, you backtrack, you get back again. And it's like, okay, now I found my way out. And there's just a lot of things in computer science that have that phenomenon where you're kind of searching, right? So imagine you're doing—you know, a common one is a traveling salesman problem where you have to, you know, kind of visit different nodes and things like that. I don't get into too many details, but you know Sudoku. Sudoku is one of these problems where you want to put in these numbers, and at some point you get stuck. You put in—let's say two ones in the same row, and it's like, 'That's not allowed.' Or you're in a position where you can't solve it without putting two ones in the same row, and so you have to back up, erase some of your numbers, and start over, right? There's many things that fall into this category, and usually they—they have one of two forms. They either have a linear form, which means you can represent it as a linear equation. So I'll give you an example. Let's say you could have horses and you could have chickens. And and you know the horses you can sell them for, you know, 20 dollars. The

0:40:19.200 --> 0:41:56.020
<v A>chickens you can sell for 15 dollars. But there's other limitations. Maybe you can only have four horses, so on and so forth. So you could describe this as a set of linear equations. You can say, 'You know, X is my horse number of horses, Y is my number of chickens,' and you can say, 'Okay, X has to be less than four, and X times 20 plus Y times 15 is how much money I'm going to make,' right? And you can plug that into a linear solver, and it will say, well, it will say infinite chickens. So you have to have the limit on chickens, let's say chickens less than 10 or something.' And it would say, 'Oh, well, you know, let's get as many horses as we can and then start filling in chickens.' So you could also say the size of the animals and add those together, right? And so as long as you can keep everything sort of linear like a set of just these linear equations, then you can use PuLP very, very fast. Um it—and so you can represent so many different problems using linear programming. You can actually represent Sudoku using linear programming. So it involves some tricks, and it's cool to read about that. But but then there are problems like navigating a maze where it just doesn't make sense like you can't really represent that using, you know, an equation. And so for that, you need branch and bound. And so what branch and bound does is it—it searches, but it does what's called a best-first search. So the idea is at every point you say, 'Okay, I don't know if if this, you know, is going to take me to the goal or not.' Like I don't have a guarantee.

0:41:56.020 --> 0:41:58.894
<v B>Of that, but I have a

0:41:59.299 --> 0:43:32.264
<v A>hunch. So maybe you know if there's two directions you could go and one direction is heading towards the exit and the other directions you're heading away from the exit, you might say, 'Well, I'm gonna—I'm gonna head towards the exit because that just generally seems like a good thing to do,' right? And that—that's branch and bound. And so the trick here is if you can get, you know, the linear programming solver and the branch and bound solver really, really, really fast, then you can kind of change the game a bit. Like you can just say, 'Okay, I have this problem. If I can represent it in this way, then I can take advantage of this solver.' This person spent so much time on, and that's—that's basically how these work. So there's people who their whole job, their entire job is to figure out how to take some problem and turn it into a linear programming problem. So I was talking with a friend of mine who works at Uber, and they actually model the decision to match drivers to riders using using a linear program. So I don't think they use PuLP exactly, but but but but they've been able to take that problem and represent it using LP. So so that's just one example, but these are really, really good technologies to learn. They're definitely you know on the more advanced side, but um these two libraries in particular are in Python, which makes them pretty accessible, and they have good tutorials and things like that.

0:43:32.635 --> 0:45:32.140
<v B>Mine is not nearly so geeky. I'm on—I'm on Theme, though. Mine is a iOS app. I'm sure there are probably equivalent kinds of apps for Android, but this one on iOS is really nice. I've used this one personally, and it's called Halide. And what this is is an alternative to the built-in application, the camera application on the iPhones. And oh, okay, the built-in camera application is really good. I mean, I like it. The iPhones take good pictures. I think almost all like I used to call like top of the line phones take really good pictures now. But there's a fair amount of—I don't know, I say like guesswork that they do when you take a picture. They may you have to make a lot of assumptions, right? Because there's a lot of trade-offs, and taking the pictures and you don't want to bombard—you want to whip out your phone and be taking the picture within like a second or two. And if you had to configure 13 different parameters, well that's not really good. Yeah. And so the default apps, you know, that that's sort of their prioritization. It makes sense. But it turns out like the sensors have been getting better and better, and so there's actually a lot of whatever you want to call latitude that that you can do. And the this Highlight application is one you can bring up instead of the normal one where you are able to take raw images from the camera. So the Camera API support giving this sort of full bit depth image at least on iPhone. I'm sure something again exists on Android, but on iPhone it allows you to take the full raw images. And when you take them and you look at the picture that's been taken using the Highlight app, it looks kind of bland. Like it doesn't look like the colors don't really pop. It isn't—it doesn't look that good. But it's okay just I'll spend a little bit talking about this because it's actually on topic, um that when the image when the image is taken that a

0:45:32.140 --> 0:47:31.020
<v B>Normal JPEG has what we call like a bit depth of eight bits, which is there are at each location in the image there's a red, green, and blue value. And that can be zero to 255, eight bits for each of the three. But in reality, the image sensors can sense more color than that. They can often sense 10 bits, which is four times more colors than that than eight bits, or sometimes even 12 bits, which would be 16 times more than the eight bits. And the problem though is the sort of common image formats, people's displays—those are all almost universally eight bits and or sometimes you hear called 24-bit color, but that's not 24 bits per color; it's 24 bits total: um, eight red, eight green, eight blue. And then sometimes in computer graphics, you'll hear eight bits for Alpha as well, so to make a 32-bit number RGBA. Um, and so these RGB if you hear 24-bit color, which is what most screens kind of do, that's eight bits per color channel. And so this one can do more, but it can't display all those 12 bits at once. So you have to—if you effectively think about like a number line, the number line is really big. You either have to sort of normalize it down where you get what you want to call like quantization errors, where two if you're only one bit apart in the original image, you just collapse to the same number, right? So you collapse the entire range down to a smaller range. But you can also do, which is if you've ever seen this sort of High Dynamic Range imaging kind of stuff, you can also bring down various parts like, oh, they're really really bright pixels; I want to bring those down, but I want to leave all the rest of the image the same. And so if you imagine taking a picture like of a forest and a sunset, the forest would probably be in like shadow, but the sunset is going to be very bright. So what you could do is say, oh, I want to raise up the dark pixels and then move the whole image to just be

0:47:31.020 --> 0:49:28.984
<v B>more in the brighter range. Um, and it allows you some more—it makes some more flexibility there because you're preserving the whole bit depth. And when you take your um when you use the default camera app, it's making those decisions for you. It's trying to do, and they're really smart at it now. So they'll do things like actually take multiple images and stitch them together, use some machine learning that they've done to kind of like figure out what are the dark parts of the scene, the light parts, what how best to combine them for an aesthetically pleasing image and to make kind of beautiful colors. But it ends up being kind of your pictures look like everyone else who's taking a picture of the same scene because everyone's roughly doing the same thing. Instead, if you're like, oh, I really care a lot about the clouds in this picture or I really care a lot about the textures of the trees and I don't care about the clouds, you want to make your kind of own decision. Then having an app like this Highlight One and this RAW imagery allows you to uh if you ever kind of played with the sliders and editing the photos and you notice like, oh, if I make it too bright, it looks really bad. If I make it too dark, you get the graininess to the photo very quickly. Um, this allows you to kind of have a little more room on the slider before you start getting that really nasty graininess pop in. Um, but it's a more manual effort. But if you if you ever use—so like I'm not very good at it, but I do have a Digital SLR camera. I kind of know how to shoot it in Manual mode. Um, I understand the complexities. I know how to edit it in sort of Lightroom on my computer. This brings back to me without that full setup some amount of the pleasure that comes from that flow of being able to make very artistic or more realistic to kind of how I remember a scene pictures rather than just sort of the standard flat image because if you ever take a picture of a sunset on your camera, you're like, it's beautiful. Let me take a picture. And then you look at it later like, oh, this is like some boring. Yeah, this doesn't look right. Right? That's because your eye doesn't perceive it the same way. But you can sort of bring that back um and you're trying to make it look like you remember.

0:49:29.136 --> 0:49:31.026
<v B>it. Um, and so I think that is

0:49:31.026 --> 0:49:40.898
<v A>there a lot of variance there but among people or do you think that i'm sure there probably eventually the the the camera will just will just do everything automatically i mean i

0:49:41.505 --> 0:50:20.149
<v B>think it's hard from the camera's perspective because without them asking you which is so to be fair this application is a little harder to use because you can do things like i want to set where my focus is versus if you bring the camera out and just take a picture it's going to try to get as much of the scene in focus as possible because it doesn't know any better it doesn't know what you're trying to take a picture of that bear in the distance the person in the front the clouds of a beautiful sunset like it doesn't know um so that's why you'll see things like they'll now put boxes around people's face under the assumption that if a person's in your image and close you're probably wanting them in focus um yeah that makes

0:50:20.149 --> 0:50:21.145
<v A>sense and so you'll

0:50:21.499 --> 0:50:49.579
<v B>make they'll make all these hacks and so i don't think they'll ever converge because it requires way too much back iterative back and forth process right um but this highlight app it sort of re-exposes a lot of those knobs to you if you want to fiddle with them so it's a much slower picture taking experience but i also sometimes shoot like old school film and that's an even much slower process with a very long feedback cycle before you sort of can develop the images and see what it looks like you literally have

0:50:49.579 --> 0:50:51.554
<v A>a dark room and you you do yeah

0:50:52.262 --> 0:50:52.819
<v B>development yeah yeah

0:50:52.819 --> 0:50:53.714
<v A>wow that's amazing yeah i

0:50:54.507 --> 0:51:14.183
<v B>never did it growing up i just like it part to me it's just the chemistry of it is really cool uh i guess i'll have to show this one point yeah i actually did one step further where i did um like silver chloride raw chemicals to make my own sort of uh paper that was photosensitive and like exposed into yeah yeah just because i was like i want to know how this

0:51:14.537 --> 0:51:15.938
<v A>works that is unbelievable but

0:51:16.377 --> 0:51:22.401
<v B>I'm by no means good at it or sort of consider myself an artist, but no, but it's amazing. It's sort of fun to do that.

0:51:22.401 --> 0:51:29.839
<v A>It's fun to me. Like I don't know. Yeah, yeah. I mean, you just built something that everyone else is just dependent on. Yeah, so I

0:51:29.839 --> 0:51:39.400
<v B>like knowing how to make pictures the way they did like a hundred years ago for, you know, if the whole world has Armageddon or whatever happens and everything goes away and like if we

0:51:39.664 --> 0:51:41.504
<v A>go into nuclear winter, I'm going to your

0:51:41.504 --> 0:51:45.840
<v B>house. Rebuild the world from scratch. I guess I'll bring the photography equipment. It'll be

0:51:46.515 --> 0:51:52.455
<v A>great. Yeah, I'll bring the dog food. You bring the photography, uh, photography equipment. Will be all set. So um, but

0:51:53.822 --> 0:52:10.340
<v B>yeah, anyway. So how light? How light is the name of the app? Uh check it out. You would want to pair it with, you know, some ability to edit these files. It's really good at taking them, um, but you need something which I can't—I can only share one tool to show unlike Jason who cheats. Um there are many, but you know, you also want one that does good editing.

0:52:10.815 --> 0:52:14.427
<v A>Yep, that makes sense. Like, but you wouldn't edit on the phone, would you?

0:52:14.747 --> 0:52:23.792
<v B>Uh, I do. Yeah. Oh wow. Yeah, I mean, you could export onto computer, but look, that to me is a different workflow. If I'm on my computer, I probably might as well just have taken it with the SR. Yeah.

0:52:24.332 --> 0:52:25.311
<v A>That's a good point. So,

0:52:25.779 --> 0:52:29.732
<v B>because the image. All right. Okay, let's on to

0:52:29.800 --> 0:54:25.300
<v A>image processing. Um I could—I could get started here. Um so you know, I think one thing a lot of people don't realize is just physically what's kind of happening. Um you know when you take an image, right? So you know, I mean everyone knows about, you know, I'm sure everyone knows about photons. You have the sun—it's big ball of light. It's sending out tons of photon energy. Those photons are bouncing, um, you know, all over the place. You can have, you know, light bulbs doing the same thing. Um and some of these photons bounce and hit you in the eyeball. And so what happens is you have these photoreceptors that, um, let's say integrate or accumulate these photons. And so if more of the photons are hitting, you know, these receptors at a faster rate, then they are just more excited, right? And so that ends up turning into some electrical charge, um, which then your brain kind of post-processes and turns into an image, right? So a camera doesn't actually work that differently. The way the camera works is photons are also coming in and hitting the camera, um, photoreceptors, and then there's these uh kind of like wells. Think of it as like little U's, and and photons are coming in from the top and they're hitting this U, and because it's kind of a U shape, it's sort of trapping the photons almost like a crab—a crab trap or something. These photos are kind of trapped in this well, and statistically it's just very difficult for them to be able to bounce out. Um and so then what you could do is you can measure basically how many photons are trapped there. Um so that's that's at a really high level. Um you know what's going what's kind of going on. Um so now you have sort of the I guess it's probably even more raw than the RAW format in the iPhone, it

0:54:25.300 --> 0:55:13.504
<v A>is extremely raw. Just this is the amount of energy that I've captured by with this photoreceptor. Um and then typically what you're going to do is you're going to um, you know, kind of turn that into a more simple kind of integer, discretized image. So you're going to um, you know, take these quantities of energy, this 2D field of energy, and you're going to say, okay, this spot right here is relatively really bright. Or you maybe have some absolute point of reference. You say, okay, I want that to be, you know, 1.0 if you're or let's say 255 if you're doing, you know, 8-bit, and then say, okay, this point right here there's very little energy so it's going to be my zero. Everything else is going to be somewhere in between, and boom.

0:55:13.504 --> 0:55:14.460
<v B>Now I have some image.

0:55:14.460 --> 0:56:09.023
<v A>Um that's so now, so now that's sort of the raw image. Um but there's, you know, a lot of regularity in that. I mean, there might be let's say a wall which is completely white. So if we have to store, you know, 255, 255, 255, 255 like next to each other, that's going to take up a lot of space, but there's not really a lot of information there, right? I mean, imagine like having a file, a huge file on your computer is just all zeros, right? Because you haven't filled any of it in yet. I mean, it's kind of a waste. So there's a whole bunch of different compression techniques. Um they take into account, you know, it could be some of them are, you know, draw inspiration from the way files are compressed and things like that. Um but they also, you take into account the fact that your eye, you know, is limited in how much it can perceive, and how and what sort of

0:56:09.023 --> 0:56:10.778
<v B>irregularities are really important.

0:56:11.183 --> 0:56:29.931
<v A>So they'll actually use understanding of the human eye and the human brain to make, you know, compression very specific for images that won't keep all of the values exactly intact but will keep most of them and will make the image just way, way, way smaller. And you can imagine doing something rather similar for video.

0:56:32.395 --> 0:56:43.043
<v A>So that uh um that's basically the high level of what's going on in the processing side. Do you want to jump into how to actually process these images?

0:56:43.043 --> 0:56:52.037
<v B>Yeah. So, you know, I think with we're going to go kind of fast because I think this is a broad range topic. We might come back and revisit some of these, but once you have

0:56:52.037 --> 0:56:59.339
<v A>People are interested, let us know if there's something that you know you want more depth on. Just shoot us an email or ping us on Discord or something.

0:56:59.339 --> 0:58:50.800
<v B>Yeah. I'm pretty sure Jason just glossed over several textbooks worth of no um so once you have, you know, some in some digital form, you have the data that's been captured from your photo sensor or you have a file that's been stored and you've recovered it, you've loaded it back up again. Um you get into this sort of world of image processing. There we were talking about, you know, at the in in my tool of the show, we were talking about sort of raw image versus already having it in 8-bit. What is that process? I mean, all that is part of image processing. How do you do white balance? So it turns out, you know, our eyes see white that if you measure it in a sort of strictly photon color energy sense is not white the same white in every case. Um and so but cameras are more sensitive to that, and so they'll have a tint where certain scenes will be green or yellow. Um and how would you adjust it to make it look like I was sort of expressing before? Um one of the things is like you want it to look like the person thinks it looked like. So if you just showed, hey, here's the scientifically measured thing the camera gave, people are gonna go, oh, there's a really crappy picture. Like why is my picture outside, you know, really red? Well, there was a lot of IR content from the sun. People are going to be upset, right? And be like, well, but it wasn't red. Um and so there's all these techniques for like Jason was pointing out just like with compression for even just other things where you want to adjust how a picture aesthetically looks so that it's what people sort of perceive, not just what is scientifically measured. And so image processing we're gonna talk about other things, but in part is about understanding how to reconcile the real world to the what do you call that? Is that physiology? The sort of like how human brains perceive things. Um yeah, yeah, totally.

0:58:50.800 --> 1:00:48.320
<v B>And so that's one thing. Another thing and all these things intertwine and use each other. But at a high level you get this sort of where you want to do filtering on an image. So people will talk about I need to sharpen an image or um you can give me things like I want to find all the edges in the image. So Jason talked about for compression, maybe you want to say hey, I want to preserve the edges but in areas where there's no edges, maybe I just like make it all a single color. Um not a great idea, but an idea. And so you want to find, you know, edges in an image or you want to what if you wanted to blur the background of an image but not the foreground? Um These are common operations people sort of think about doing, and some of them have higher level goals of why you would do those filtering techniques. But there's a couple ways of sort of accomplishing them. One of them is applying—you could call them sort of kernels. They're sort of like a set of values where you want to kind of do an element-wise multiplication and then sum it up, and a little hard to explain I guess with words over a podcast and not spend a ton of time, but roughly you're taking at each physical location on the sensor, you have the values that were recorded there after some processing, and you want to go through each of those locations. But as you move, if you think about sort of moving along the row, moving through columns in a row, you're sort of moving left to right in the image, which is a representation of left and right in the real world. When you move down columns, then you're moving down in the real world, right? You're you're sort of moving in the same spatial sense as the picture itself was. And so for instance, if I blurred the first 50 of rows but not the last 50 of rows, the top of the scene would be blurred, but the bottom wouldn't be. Um doing those kinds of processing are things that take place in the spatial domain, and there's a whole slew of various techniques for doing things, like we were talking.

1:00:48.320 --> 1:02:44.480
<v B>About sort of like edges exist in the in the spatial. They're like you know you can sort of say hey, if I have that something was all one color and then it changed to another color, that's an edge, and I could sort of, you know, try to detect that spatially. But that's not the only way of doing things. And in fact, when you get to some of these images and cameras like on the phones now can be, you know, many megapixels, 10 megapixels. I don't actually know what the current phones are. Yeah, it's about 10 at least. Yeah? But then high-end SLRs can get much higher, and scientific application images could get even much, much bigger. Um and so as the megapixel count goes well just as the pixel count goes up every time you're moving in this sort of spatial sense, you're slowing further and further down. Um And so you get a lot of GPU involvement in doing this processing. But sometimes you want to do hacks by not moving through every pixel location. And one of the things you can do is switch to the frequency domain, and we've talked in the past about the Fourier Transform and roughly how that works. I believe we have, but once you convert from the spatial domain into the frequency domain, there's a whole different—I don't want to say language isn't the right word, but a whole different technique for how to apply the filters. So now we talk about things like if I removed all of Jason was talking about before. If you have an area that's relatively uniform, you could just sort of like, you know, make that all a single color. Well, what he's saying is if you sort of reinterpret it—he said an area with, you know, sort of a homogenousness to it, like a sort of consistency, that would be a lot of low frequency information. The information isn't changing very rapidly in that area versus an area like I talked about with edge detection. Those are areas with high frequency content that something is changing very rapidly in that area. So I guess they're a duality there. Um and so sometimes things are easier to do in

1:02:44.480 --> 1:03:50.166
<v B>the frequency domain. So if I go into an image and I sort of did a high pass filter that is I removed a lot of the low frequency content and just, you know, set those frequencies to zero. Um You at certain frequencies probably wouldn't even really notice that, but it's less information I would need to store, and so I would achieve some form of compression, image compression, by reducing the amount I needed to store. But then also I would cause—if we sort of revisit if we go back from the frequency domain into the spatial domain, which is what I would show on my computer screen, um after doing that high pass filter, what you would notice is the image would look different. In this case, areas with low slow changing values would sort of smooth out and just become consistent. You could also do the reverse. You could do a low pass filter and get rid of high frequency content, and that roughly kind of works as like a blur where, you know, things get averaged out over an area because the frequencies are not the values aren't able to change very quickly; they can only change over long distances. Um yeah.

1:03:50.352 --> 1:05:31.922
<v A>I think the one thing about the frequency domain that's—that's you know that's kind of hard to grasp. And I'll try to explain it over the audio as best as I can, but you know it's really hard to understand like what does what do you sort of get when you convert to the frequency domain? So I could talk about, let's say, like a cosine transform. So you know, let's say you have an image. So what is that at the end of the day? Let's just take a black and white image or a grayscale image. So you have basically a lattice or a field of numbers. And so in the top right, you have let's say 255, and that means that in that area of the picture there is something really bright. And so you can imagine looking at some picture and seeing and breaking that picture down into pixels, and each pixel having some brightness. So that seems pretty intuitive, right? But then what's happening with the frequency domain? You still have an image. So you still have a field of pixels, but those pixels aren't arranged spatially. They don't really represent the same thing, right? So so you know you have the this whole sort of geometry of this photo, right? But you could have a 2D field of anything. So in other words, let's say you watch television and there's different channels on on the remote. So there's you know Channel One, Channel Two, Channel Three, um and let's say you were to just put a number based on how much you enjoy that channel. Okay? So you really love Channel 24 and you really love Channel 32 and 58, right? So you can

1:05:33.440 --> 1:07:30.340
<v A>imagine just having this array and having just a set of numbers there. Um and you can imagine even if I mean it's kind of a weird thing to think about, but if well there are some—there's some TVs that have sort of almost like, I guess, two dimensions of channels in a sense. So you can have like a Channel Two and then a 2x2. Um and so now you have this sort of this sort of also this lattice or this field where you have Channel One, Two, Three, Four, and then going down that's going across, and then going down you have Channel, you know, 1-1, 1-2, 1-4, almost like an Excel spreadsheet of channels. And at each one you have some number from which you like the channel. So so pretty much anything can be represented in like let's say a spreadsheet or matrix or lattice, right? So what's going on with the frequency domain is at every single location what you have is a specific description of a wave, right? Because you can describe a wave by the sort of um what is it? The amplitude and the wavelength, right? So you have these two numbers that you can vary. And as you pick different amplitudes and wavelengths, you get different waves, right? And so at every point in this lattice or in this Excel spreadsheet or whatever analogy you want to use, you know, at every point there is one of these—one of these waves, right? And so then the question is, okay, you know how important is this one wave in this image? So if I take all of these waves and I give them different strengths and then I add them all together, I'll actually reconstruct that original image, right? But at any given pixel every pixel is representing the strength of an entire wave that's making its way

1:07:30.340 --> 1:07:52.879
<v A>from left to right across the whole image. And so that's something that's kind of really hard to understand, but it's really foundational because when you realize that now every pixel has an entire row's worth of information, that's the jumping point from which you can now do some really, really clever things like operate on a whole row just by changing a pixel. I think that

1:07:53.284 --> 1:07:56.187
<v B>was a pretty decent pass at doing that without illustrations.

1:07:57.402 --> 1:07:59.309
<v A>I tried my best. So so

1:07:59.444 --> 1:09:17.119
<v B>just you know trying to speed it up a little. So so we don't get this too long. Um that's kind of various approaches to filtering. You also get roughly things which I just kind of called computer vision, which is not just filtering or aesthetic improvements, but you might use some of those filtering things to perform image classification or recognition. I think a lot of people think about this as the what you might call like the stereotypical image processing case, like how does a computer know a picture of a cat is a cat? Um yeah, that's crazy hard. Um and there's many, many different ways of doing it, whether you're recognizing something you've seen before or recognizing other things. Um there's also tracking. So I have some object in an image, and I maybe I don't know exactly what it is, but I want to track how it moves over time. Um is another task that becomes using a lot of these techniques of filtering and you know cropping down the image and looking for changes over time. Um something that you can do. Um another broad class that I'll—I'll say here maybe not the best word for it, but the word that came to mind for me was oh man, I'm not even gonna probably say it correctly, but it's photogrammetry, which is photogrammetry. Yeah. So what I was

1:09:17.119 --> 1:09:18.064
<v A>trying to

1:09:18.402 --> 1:11:17.920
<v B>say. So this word, which I had seen written but I don't think I've ever heard anyone in real life use this word, is like using photos to measure things. So you know, in the classic crime scene photo, you have like they lay down the ruler next to the shell casing or the puddle of blood and then they take a picture of it. So later they can you know compare the lengths on the ruler to how big the puddle was or how big the shoe print was, and so just making measurements off of photos. But what I meant by this is a probably butchering of the use, but a lot of things where you get, you know, I have I strap a camera to the front of my bicycle and then I take a picture. I you know one second later take another picture, and if I compare those two pictures, I can see things that have moved. Um and then I can begin to understand the shape of the world around me. And that—that's called sort of structure from motion. Um With a single camera, you put two cameras next to each other, and then you can begin to try to reconstruct depth. So when you have two cameras next to each other, just like your two eyes, you get an effect called parallax, and based on how much something is experiencing parallax, you have an estimate for how close it is. So things closer to you have more parallax. You can try it: hold your finger close—close one eye, close the other eye, it moves a lot. Hold it further out, moves less. Stars in the night sky don't move at all when you close one eye or another eye. Um And so this measuring this parallax, you can get an estimate of how far things are from you in the world. Um That's a very interesting thing. Uh you'll see these projects where people do automatic stitching of camera photos, where I take a picture and then I move my camera a little and take another picture, and later they can sort of stitch it together and make a panorama. Um Yeah, to me that's not exactly photogrammetry, but it kind of falls in sort of the same thing where you're trying to not identify what something is, but identify features in an image and then try to track those features over time or match those features for sort of building up higher level

1:11:17.920 --> 1:11:22.112
<v B>understanding. Um from lower-level features. Yeah, totally. I

1:11:22.349 --> 1:12:06.578
<v A>mean there's just an unbelievable amount of depth that we could go into here, but you know would take it—would take just hours and hours and hours. I do think that you know there's a lot of super interesting topics, a variety of different methods for doing object detection, object recognition, tracking. You can't cover all of them. If there's something in particular that people are interested in, we'd be more than happy to cover it. We've both done a decent amount of image processing in our career, so you know it would be—it'd be definitely something that we'd be happy to revisit. But yeah, hopefully this gives people an overview of kind of the tips and tricks and what's really happening when you snap the

1:12:06.899 --> 1:12:23.200
<v B>photo on that. Um Yeah, like Jason said. I mean, I think we could take this any number of things. I actually think we probably will. Like I know Jason, you have a lot of experience with sort of the Machine Learning aspects and probably talk a little bit to how Machine Learning and image processing come in to interact with each other. Yeah, totally. We could

1:12:23.622 --> 1:12:25.427
<v A>do like a Part Two. Yeah. I

1:12:25.780 --> 1:13:09.040
<v B>I think that'd be really good. And I do want to mention that the like Swiss Army Knife of machine vision is OpenCV. Um so I mean, I think I don't even know how many years now I've used OpenCV at various points one thing or another, but almost anything you would want to do in computer vision, they probably have a function—a function or implementation of it in OpenCV for just all sorts of things. And so it also involves it also has abilities to show images and open images, and it's not the only thing for doing that, but it does have many, many advanced algorithms as well as a lot of basic algorithms, and that's available, I know, for both Python and C++. And I'm sure has bindings for

1:13:09.040 --> 1:14:31.669
<v A>other languages. Yep, yeah, OpenCV. If you're willing to invest the time, it is amazing. I mean, it's got everything. It's insanely fast. Um they've all these sort of specializations for if the image is floating point, if it's, you know, different different formats of images, it handles them the most efficient way possible and all of that. Two things, two libraries that are a little more for beginners: there's Python Image Library, which is quite good. You can do some basic things like edge detection, dilation, things like that. There's also SciPy ndimage, which is really interesting. I don't know why they made this such a focus, but it supports arbitrary dimensional images, so you can have a 27-dimensional image. The only thing I've ever found that useful for is for videos because you could think of a video as a cube where it's just a set of images that are kind of stacked up in a third dimension, right? But both of those libraries are, in my opinion, more accessible. But if you're really going to be serious about image processing, you're grabbing a good book on OpenCV or diving into the tutorials is definitely the way to go. That library is fantastic.

1:14:32.226 --> 1:14:35.972
<v B>You know just a random bit of trivia, but I think that

1:14:35.972 --> 1:14:53.286
<v A>Okay, so OpenCV wasn't invented in Willow Garage, but it was basically productionized at Willow Garage, which is just like a hardware hacking place that shut down I guess about four or five years ago, but it was pretty famous for doing all sorts of crazy robotics.

1:14:53.742 --> 1:14:55.699
<v B>Right. Well, till next time.

1:14:55.699 --> 1:15:29.972
<v A>Yeah. It's been great. As I said, you know there's been—there was a chance to kind of meet with some fans and things like that, which is awesome. Keep writing in, keep giving us your ideas, your show ideas and other things we'll have to hear from you on our next episode. You know think about interview episodes. You never it's never a guarantee, you know. It could always fall through, but fingers crossed. You know it should be fine. We're gonna have a really cool interview coming up next month. Really excited to get to it and

1:15:29.972 --> 1:15:31.272
<v B>We'll catch you all then.

1:15:35.457 --> 1:15:57.600
<v A>The intro music is Axo by Binar Pilot. Programming Throwdown is distributed under a Creative Commons Attribution-ShareAlike 2.0 license. You're free to share, copy, distribute, transmit the work to remix, adapt the work, but you must provide attribution to Patrick and I, and ShareAlike in kind.

