Hacker News new | past | comments | ask | show | jobs | submit login
I wired a Christmas tree with 500 LED lights and calculated their 3D coordinates (youtube.com)
386 points by liotier on Dec 24, 2020 | hide | past | favorite | 87 comments



Hah! Right as I wrote this: https://led3dmap.lights0123.com/


Have you posted this in HN? It could be a nice submission. (It would be nice to see also the original video.)


Nice! I was momentarily confused by:

> Fully client-side: your video is never uploaded ... > Now, upload your video.


If you do two views 90 degrees apart, that limits your FOV to one side of the tree, right? (You can't see the back side?)


Yes, but for my use case that wasn't a problem (the tree was see-through enough). For the few pixels that weren't visible to one or both angles, it automatically guesses its position based on the pixels before and after it.


I love when folks combine technologies in a new domain and get neat results. This is a great little demo and probably a cool way to force yourself to learn the related technologies.

My first thought was that this could be pretty easily commercialized, which meant someone has probably already done it:

https://www.twinkly.com/

Here's the setup, actually seems like a pretty nice UX - https://www.youtube.com/watch?v=xMJ3bLBtGaQ

Edit: They sell them at BestBuy, brb lol


It’s more than a bit creepy how Twinkly actively show locations of where setups have been mapped around the world, and even creepier that they show the time of the last device mapped. Sure it might be innocuous but are there other things that can be collected? If anyone has this, is it possible to opt out.


There's a lot of analogs. At least in Europe - €60 for 1200 LEDs (with the same mobile app).


hints for brand names etc?


I picked up a set of Twinkly lights this year and liked them so much I got a few more sets to give as gifts. The API appears to be local network accessible and there are a couple libraries written in python and node for playing around with them.

The mobile app is decent, with a few bugs, but it does include a cool mapping feature to map the layout of lights so the effects work correctly. Definitely would recommend checking them out.


Just got back and set them up. It's not cheap but it's a lot of fun!! My daughter now has a rainbow Christmas tree.


Is the 3D mapping that the app gives you available in the python libs?

Eg. can you put the lights into a tree, get the coordinates with the app, and then continue hacking around with those libraries?


We have these on our office tree - bought them from John Lewis in the UK. Was very happy to find something like that as I felt Christmas decorations had been left behind in the smart home thing a bit


> Christmas decorations had been left behind in the smart home thing

That's very true, but equally does it matter? Currently, these products are usually so un-seamless so setup and faff around with that I was seriously considering just making my own with some ESP32s I had lying around.


Doesn't need to be super clever etc for sure, but I'd certainly be happy if there could be a Philips Hue set. Or tbh even just something basic for turning them on/off would be at least slightly helpful


Smart home, eh... looking forward to the news that Russian hackers infiltrated some secure infrastructure through their IoT Christmas tree...


I'll watch the whole video later (as standup maths is generally quite good!) but in quite a lot of skipping around just now, I'm a bit shocked not to have seen a rotating cube drawn on the surface of the tree. That's the one thing I was specifically expecting for some reason.


In that case he might as well directly play Doom on his tree.


Give him a week. He'll probably have it up and running.


Tetris would be fun.


Nope, just conic sections. Like a proper mathematician.


Yeah, shouldn’t be too difficult. I would imagine running a signed distance function between the light positions and the 3d cube model could do the job.


1. rotating cube

2. chrome spheres on a checkerboard

3. Bad Apple

Sorry, those are the rules.


A similar project was done here by someone who used an ESP32-CAM module to detect the location of each pixel.

https://www.youtube.com/watch?v=Ueim2Ko8VWo&list=PL5vDt5AALl...


For anyone getting into LED stuff without much design background, I can not recommend this enough: desaturate your colors.

    pixel_RGB[i] = Math.max(90, pixel_RGB[i])
It will make an absolute world of difference in the aesthetic, and it's one line of code.


A rather simple improvement would be to have all the lights flash their binary encoded position for the calibration step. You go down from calibration time O(n) to O(ln(n)). Using red/blue would be better than using on off for this since you can get a more accurate position read by averaging ln(n) shots for the location of a light.

I believe something similar is used by some projection mapping software.


You might even encode the position in color, and do it in O(1)! Depending on the sensitivity of your camera, though :)


Impressive and only in 102-lines of python code; https://github.com/standupmaths/xmastree2020/blob/main/xmasl...


I love Matt‘s work so much. His channel has grown well beyond „one of them Numberphiler’s personal channel”. Great to see!


Is there a good source of long strings of addressable lights that doesn't involve any soldering or cutting up wires to get the power right? I have bad luck with actual hardware projects and they usually end with the magic smoke escaping, so I'm really looking for something I can plug into a working power supply that's included in the box and can talk to over like a serial port or something else that I can just plug into a USB port.


> that doesn't involve any soldering

You do you, but if I may suggest that if electronics projects interest you at all, it’s worth a little bit of time to learn some basic soldering skills. Not only will it give you a lot of flexibility, even just a little investment of time in learning basic soldering techniques will almost certainly save you time in the long run.


There are several options, search for "WS2811 LED String" for starters. I have used the same string (more or less) that OP shows in the video with ESP32's and/or Pixelblaze controllers for various projects.


I hereby predict "LED-paint". It is a mixture of luminescent particles, semi-conducting liquid and maybe some measure of resonating metal particles. You paint the wall with this paint and then let a computer and a camera learn how to make lights blink by generating suitable wave patterns and frequencies. There after you can show whatever you want on the wall.


I wish the IPv6 Christmas tree was back! http://ipv6tree.bitnet.be/


> We were happily processing 96Mpps earlier today... Then suddenly we got a call from our uplink provider... They were actually amused to see 180Gbit/s of ICMPv6 traffic... They were not so pleased however with the saturated backbone links in 3 European countries...


Hah, 16:13 funny thing this world... Not that long ago I was at a job interview where they asked me to write a function that checks for a winner for 4-in-a-row. I gave a solution which used pretty much the exact same algorithm except in a 2-dimensional space. What was really cool imo that the solution fits in ~11-12 lines of python, even without using creature comforts like numpy.


I've been thinking of doing this so long and its amazing the convergent evolution happening here.

xlights.org seems like a fantastic project.


I do a lot of LEDs so this was fun to see. My plan is to use ARKit to calculate positions, which should save a lot of the time otherwise spent rotating the display. More or less the same approach as this, just finding the brightest (or greenest) point in the point cloud.


Jesus Christ YouTube has a lot of ads now. I had to watch 2 before I started and then there were 3 more adbreaks. In a 20 minute video! I may as well go watch TV

Also - cool project


Browsing the Web w/o propper AdBlock/SocialBlock is a thing I don't understand. Also deleting Cookies everytime the browser closes is a must for me.

But yes i see what you mean when i watch yt on my mobile.


Yeah I was in the youtube app which seems to be even worse than desktop, I guess because they know they've got you!

And I refuse to pay youtube for that god damn subscription they pop up to me every 5 minutes - especially after they started removing basic features from the app (like background audio) just so they could charge for it. NO youtube. Just NO! The more you coerce me, the less chance I will ever do it.


Not my project, but someone cool took the YouTube and removed all the ads and even added experimental sponsor skip:

It used to require rooting, but not anymore! It just requires microG if you want to login to your google account.

YouTube adVanced https://vancedapp.com/


Off topic but, on mobile I use Youtube vanced which is perfect. It blocks ads, allows for picture in picture, background play and a dark theme.


It recently got sponsorblock integration too, so you can cut out native advertising and repetitive intros/outros.


You can use Firefox on mobile.


One solution to the number of ads is to simply download the video with youtube-dl (http://www.yt-dl.org/).

Copy out the HN youtube URL, run youtube-dl, giving it the URL, wait a minute or two, and you have a 24m37s video with zero commercials.


Ads on youtube are horrible, luckily you can still use unlock to bypass them


You can also just pay YouTube for unlimited ad-less videos (side from the sponsorship pitches that are so frequent nowadays)

It's honestly a little worrying that people have the nerve to complain about ads if they can remove them entirely just by paying the fee.

What makes you think you deserve free unlimited service?


This is always a frequent refrain but then you have to be actively ignoring the lessons of previous technological changes. TV was ad free. Then ads started appearing. Then you paid for cable to get rid of ads. Then ads started appearing there too.

Advertising is a corrosive industry.

I personally find it unlikely that YouTube Red will inevitably have the same fate. Hell, Netflix has experimented with ways to try to do that and eventually some experiment will succeed (they already do that to some extent by hiding it in their recommendation engine).

[1] https://thenextweb.com/google/2017/09/18/google-youtube-red-...


> I personally find it unlikely that YouTube Red will inevitably have the same fate.

Do you mean "won't"?

Unrelated: I believe Netflix already makes some money from product placements in its "Netflix original" content.



When YouTube added little banner ads, I didn't really mind. They had to make the service profitable, after all!

When YouTube first allowed creators to monetize their videos using ads, to support themselves, and youtube would pay them and also take a cut? I certainly didn't mind. It promoted good content, and they've got to make money after all!

When YouTube decided I could no longer turn off my phone's screen when I played a video, I began to mind. I thought it was a bug at first, but then I found out it was intentional. I guess they have to make sure we're looking when they play ads. Gotta make money after all.

When YouTube made their terms worse for creators multiple times, I read on with sadness, but it didn't really affect me, and they've gotta see revenue growth, or something.

When YouTube started actively screwing creators out of monetization for bizarre and arcane reasons, but would then still show ads on the de-monetized videos, and collect the full take? I felt miffed. They don't need the money that bad -- if it's demonetized, it shouldn't have ads. But what could we do? Stop watching?

When YouTube started aggressively nagging me to sign up for their paid service to "unlock" those old "features" like no ads and playing videos when my screen is off, I was pissed off. They really gotta make money like this? I still see these nags daily.

When YouTube recently decided that on all videos, even ones the creators have chosen specifically not to monetize (e.g. because they're intended as educational content), YouTube will force 10-15 seconds of unskippable ads for every 10 minutes of video, and then take all of that profit?

Fuck 'em. They don't need the money. YouTube is rotten to the core.

One of the richest corporations on the planet has forced these intrusive, shitty ads upon literally billions of people, degrading their hugely profitable service with no real alternatives, and you feel the need to defend YouTube here? You're "worried people have the nerve to complain"? You tell us, "you can all just pay up!"

What a sickening disgrace! Collaborators are tragically easy to find.

To quote Pratchett, "It was as if even the most intelligent person had this little blank spot in their heads where someone had written: "Kings. What a good idea." Whoever had created humanity had left in a major design flaw. It was its tendency to bend at the knees."


That's how one gets year over year ad revenue growth from an audience size that grows at a smaller rate. Expect the trend to continue.

They haven't started to monetize the Google assistant yet, at least from the consumer side. But even that mindset is starting to change, if you want to control your own thermostat using their APIs outside of the apps, well, it's a non refundable $5 charge [0].

[0] https://developers.google.com/nest/device-access/project


OMG we're trapped inside MATLAB!


> (side from the sponsorship pitches that are so frequent nowadays)

SponsorBlock does a great job of removing those, too.


A remarkable achievement, and it's crowdsourced too!


I didn't say I had something against ads. I don't expect something for nothing. But the ads are getting really out of hand recently. You used to get an ad at the start of a video, and not even every video. Now it's 2 before every video - and multiple ad breaks along the way. This is just a terrible experience and makes me hate using youtube.


>> What makes you think you deserve free unlimited service?

What makes YouTube think they deserve free unlimited content, and unlimited ad revenue?


They don't, which is why a lot of the money for YouTube premium goes to the content creators videos you liked and watched. The only way that they don't get paid is if the premium user clicks dislike.

https://support.google.com/youtube/answer/6306276?hl=en


Youtube reached market saturation a few years ago, and having accomplished this, began a ten year program to destroy itself by extracting profits at a market-competitive growth rate.

Backup whatever videos you enjoy now. It's going to get worse.


Being a resident of Georgia, (the US state) the constant stream of political ads convinced me to subscribe to YouTube premium a few months ago.


They're actually illegal in the UK (although the web seems to be a huge grey area) - I can't imagine how fucked the country would be if we had those kinds of spending and broadcasting rules.


Speaking on behalf of US residents:

We can imagine it.

At this point the most successful grassroots political movement of the last several years acted on behalf of a dictatorial head of state and took guns into state capitols to explicitly threaten state-level politicians in order to convince them to give everybody a deadly virus. And is threatening to do the same to the national legislature in a couple weeks in order to convince them to create a new category of President For Life.


I watch from Safari on an iPhone with an ad blocker and I rarely see ads


[flagged]


This is his main job [1], so I guess he had no problems at home. https://en.wikipedia.org/wiki/Matt_Parker Also, his wife has a technical background and have some similar activities (but not full time, IIUC), so she probably even helped.

[1] Or at least this is the kind of potentially viral videos that can increase his internet presence and his revenue in the live talks and shows.


She is a Physics professor at UCL, and works on solar Physics: https://en.m.wikipedia.org/wiki/Lucie_Green

She is also quite nerdy.


I feel that OP’s idea that Parker’s wife wouldn’t be on board with “nerdy/tech-y stuff” smacks of sexism to me. No reason she couldn’t be an equal partner in this, or at least a non-detractor.


You might be seeing sexism where there is none. His wife (partner) might really be a man (I have no idea and don't really care) and it would not make any difference on OP's comment (I assume it can happen that one person in a couple has a very seemingly useless hobby which is so time consuming that it impacts their house keeping involvement, regardless of their genders).


"wife" doesn't mean "partner", in case anyone else reading this thinks otherwise.

If you don't want to assume a man is heterosexual, don't assume he has a wife.


Yes, i guess "wife" assumes he has a partner, that this partner is a woman, and probably that they are married too. I don't think any of this really matters here, I think the joke can be understood even if none of those assumptions are true :)


Also, if we are nitpicking, I'll add that the gender of the person you are married with is only loosely related to your sexual preference (ie there might be homosexual men that are married to a woman for some reasons - cultural or legal for example, depending on the country you live in) ;)


You're not wrong that all words about human identity and behavior and politics have fuzzy (or really no) boundaries. But this is not a nitpick you can apply to my statement. I'm not saying to assume people's sexuality from their gender and the gender of their partner.

If your stance is that it's not necessarily sexist, which honestly I respect in part, it's nonsense to argue that the comment may not be sexist, because "wife" may mean "husband". It's not a competition to see who can make the fewest assumptions.


I did not mean that wife means husband in general, but I meant that it may not have been used here to specifically point out the gender of the partner but more generically (as it's common for to assume opposite gender for the partner even without malice)


Do you not see how the two go hand-in-hand, your "gay man married to a woman because it's illegal to be gay in his country" and "it's common to assume opposite gender"?

I don't know what malice means to you, but I can tell you on my behalf and on behalf of many queer people (I won't claim to speak for all, but I know I speak for many), you should not assume the opposite gender for the partner, and it is unnecessary to defend someone who makes the mistake. Ultimately, it _is_ a factual error, and it is invalidating.


What I meant by malice is someone whose point would be "it's abnormal to be married to someone of the same gender" vs someone assuming the most common case without holding any judgement on whether it's normal or good, and without the intent of hurting anyone (I do understand that it can still hurt/vex some people, as anything else you can say with the best intent, but I still think intent does count)


I agree intent counts. You start by saying "You might be seeing sexism where there is none.". To me, our comments are summarized with:

You: "it might not be sexism because people often assume heterosexuality, but the statement could apply to a partner of any gender"

Me: "well then that's heterosexist"

You: People can make the heterosexual assumption without bad intentions, so it's not heterosexist either"

And that is true only for a narrow definition of sexism and heterosexism. Do you want to give a different name to the assumption that people are straight? Do you want to give a different name to the assumption that someone's wife isn't on board with his technical pursuits? I already have a name for those patterns, heterosexism and sexism, and I can grasp the nuances and subtleties of different forms. What is YOUR intent? To reserve those words for cases where there is ill intent?


Ah I had never heard "heterosexism", I learned a new word. I just checked a bunch of definitions, and I would now use "heterocentrism" for presumption of heterosexuallity - it's possible to presume that without thinking it's the norm, but just because in practice in many places it's more common. Just like when I hear someone named Daniel(le) I assume it's a man because I know more man Daniel than woman, but I do not think there is anything wrong or abnormal with a woman named that way. So yes I would kind of reserve sexism (or heterosexism now) for cases when the remark carries some negativity related to a given gender (or sexual orientation). And I still stick with my original impression that OP did not carry any negativity towards women (at least we can fairly give them "reasonable doubt"), but that they were just making a joke about living with someone else in general.

Sorry for the long thread and I hope I have not offended you. I'm always interested in having other points of views so I like this kind of discussion. Also English is not my native language, so there might have been things lost in translation.


Horse: He made a joke.

Zebra: He's a sexist pig who can't fathom the idea of a technical woman working on something with her technical husband.


100% agree. I did a very similar project this year - at my wife's insistence. Guess who's done most of the programming now that I've got the techy hardware side done?


If that's the case why didn't he mention her help?


Parker definitely mentions her input and discussions they have about these topics in other videos and interviews.


I'm not sure that she helps him, but looking at the sibling comment, it is not a bad guess.

I ask my wife a lot of questions, for example if I get stuck in a calculation or a result makes no sense. Sometimes about the redaction of a sentence. Sometimes just general questions over diner.

She ask me too. I remember that she was missing a transpose sign in his dissertation, and I found the error. It was a tiny fix, and no worth mentioning.


Or, he could have a healthy relationship with boundaries and mutual respect, where his wife understands the need for his own time to do what he enjoys.


How about some AI/ML, so lights go on if you make a gesture, or if a person walks past the tree.


Why some catchy name like AI for this? Connect some sensors that measure distance from object and use them.


You want a Christmas tree version of xeyes?


Yes, but xload would also be cool (even if much simpler to implement).




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: