Content Aware Scaling in C

  Рет қаралды 26,184

Tsoding Daily

Tsoding Daily

Ай бұрын

More Episodes: • Seam Carving
References:
- Wikipedia - Seam Carving - en.m.wikipedia.org/wiki/Seam_...
- Shai Avidan, Ariel Shamir - Seam carving for content-aware image resizing - dl.acm.org/doi/10.1145/127580...
- Wikipedia - Sobel Operator - en.wikipedia.org/wiki/Sobel_o...
- Stack Overflow - Luminance Formula - stackoverflow.com/questions/5...
- Morten Rieger Hannemose - Recreated Lena Picture - mortenhannemose.github.io/lena/
- Tsoding - Seam Carving Implementation - github.com/tsoding/seam-carving

Пікірлер: 90
@angelcaru
@angelcaru Ай бұрын
Really appreciate you putting chat messages in subtitles
@U20E0
@U20E0 Ай бұрын
WHAT?!
@cherloire7978
@cherloire7978 Ай бұрын
I wonder if its something he programmed to do automatically from the vod
@angelcaru
@angelcaru Ай бұрын
?​@@U20E0
@CoolestPossibleName
@CoolestPossibleName Ай бұрын
​​@@cherloire7978 No I'm pretty sure he did it manually. That's all he does in his free time
@Kitulous
@Kitulous Ай бұрын
piggy backing so that @tsoding can potentially see it: please at least put 3 to 5 comments at the same time, otherwise it's very hard to keep track of the history of the comments. btw why did he (you if tsoding is reading this) remove the chat window? I've recently seen some of his older videos and the twitch chat was on the right, it was super convenient
@Cmanorange
@Cmanorange Ай бұрын
thank you for using ethically sourced lena, it wouldn't have been nearly as funny
@gummansgubbe6225
@gummansgubbe6225 Ай бұрын
Watson-Watts said it like this: "Give them your third best solution. The second best comes to late, the best never comes". He was a pioner in radar development before WWII.
@anon_y_mousse
@anon_y_mousse Ай бұрын
All of the failures before you finally succeeded were hilarious. One suggestion there is to make a video of all the intermediate images. I'll have to remember that about the chat, because sometimes they say useful things. As far as memmove() and memcpy(), I think the biggest reason that so many people have problems with them is because C tries to make arrays friendlier to use by scaling your indices by the sizeof the base type of the array, yet when you call one of these functions they expect the element count in bytes. It might be more useful for people if we had an arrmove() or arrcpy() function that took the base pointers to move/copy to/from and then expected an element count. I suppose you could just wrap the calls to memmove() and memcpy() with a macro and call them with sizeof(*a)*(elem_count) for the last argument.
@diegorocha2186
@diegorocha2186 Ай бұрын
You really need to have balls to refactory code like you does lol I really like to commit a save point first, because if I get lost during the refactory I don't like to depend on undo. But I think this is a skill issue lol thanks for the great content Mr. Zozin!
@SeishukuS12
@SeishukuS12 Ай бұрын
That's really awesome how well that works for something so simple, thanks for the video!
@ecosta
@ecosta 19 күн бұрын
Yo... That algorithm is almost a thunderstorm simulator with all of that energy and path of least resistance talk.
@hugoviala7365
@hugoviala7365 Ай бұрын
@TsodingDaily if you liked working with energy on an article, I have a fond memories of implementing "As-Rigid-As-Possible Surface Modeling" by Olga Sorkine and Marc Alexa. It’s easy to find online. It uses another energy minimization approach but to compute animations. It works in 2D and 3D and, from what I remember, is not _that_ hard to implement (you might need (or implement yourself) a matrix algebra library though). Thanks again for you videos, always enjoy them !
@bigmiraclewhips
@bigmiraclewhips Ай бұрын
this was a great video. really interesting concept for a programming session.
@LuizFernandoSoftov
@LuizFernandoSoftov Ай бұрын
Hi, always a great content... Have you ever done or thought about doing anything related to LPR? License Plate Recognition?
@linuxlover1718
@linuxlover1718 Ай бұрын
Tsoding myaahn, u r an inspiration. *salute*
@aldutran
@aldutran Ай бұрын
Every time I think dead internet theory isn't real I get reminded of your twitch chat
@ar_xiv
@ar_xiv Ай бұрын
I’ve used this feature in photoshop (and kept the result) like… maybe once in 10 years lol. It is a cool algorithm though.
@user-ec3rm9wr1n
@user-ec3rm9wr1n Ай бұрын
He should focus on security...
@ar_xiv
@ar_xiv Ай бұрын
@@user-ec3rm9wr1n nah I support random projects like this it’s cool
@user-uf4rx5ih3v
@user-uf4rx5ih3v Ай бұрын
Damn ethically sourced Lena looking even better! Looking forward to the video game in ada video!
@matthias916
@matthias916 Ай бұрын
The twitch subtitles is a really nice touch
@juanfranPP
@juanfranPP 29 күн бұрын
I beg to differ this algorithm "works perfectly on faces" this is amazing!!🤣
@Czeckie
@Czeckie Ай бұрын
1:23:22 that formula is wrong. If the value for dx=-1 is smaller you never actually check for dx=+1. Also, I think the direction of the seem could be already computed in the dynamical programming step for each pixel. Another cool idea is to do the re computations only locally along the seem, since most the picture haven't changed.
@apppples
@apppples Ай бұрын
specifically he biased it towards moving to the left and thats why the images were getting distorted
@Eugensson
@Eugensson Ай бұрын
QOI (Quite Okay Image) and QOA (Quite Okay Audio) formats implementations when?
@SimGunther
@SimGunther Ай бұрын
We definitely need QOC (Quite Okay Compiler) ASAP!
@Eugensson
@Eugensson Ай бұрын
@@SimGunther qcc
@ndrechtseiter
@ndrechtseiter Ай бұрын
@@SimGunther we would surely love to have some QOC!
@weekipi5813
@weekipi5813 27 күн бұрын
Why don't you code GIT (the notorious version control system) from scratch in C? It'd be a very interesting topic.
@SlinkyD
@SlinkyD Ай бұрын
I read the description as "Sean Carving".and thought "R.I.P. just killed with code".
@multicoloredwiz
@multicoloredwiz Ай бұрын
Ronaldo fink mullen... taken too soon
@colinmaharaj50
@colinmaharaj50 Ай бұрын
I love this
@artemiasalina1860
@artemiasalina1860 Ай бұрын
I wonder if it could be extended to add space, and if it could also be extended to add/reduce space vertically.
@kjetilindrehus6794
@kjetilindrehus6794 Ай бұрын
How do you find so many cool papers😮
@MrKristian252
@MrKristian252 Ай бұрын
This is super cool
@kossboss
@kossboss Ай бұрын
that was pretty classno bratan. ya learning ochin good s taboy.
@sanjaux
@sanjaux Ай бұрын
1:51 Man being able to choose a topic for recreational coding and having to worry about it using AI is truly a sign of the times
@Bloodthirst
@Bloodthirst 5 күн бұрын
@47:30 shouldn't that be "mn + (mat[i] / (mx - mn))" ? you're including the min offset into the division when it shouldn't
@alihanyalcn7073
@alihanyalcn7073 Ай бұрын
Damn, my current hw for computer vision is exactly this topic.
@xProsek
@xProsek Ай бұрын
Do you have a video with Mutex Locking | Thread Synchronization? I need that for my project
@xProsek
@xProsek Ай бұрын
nvm found something :D
@RandomGeometryDashStuff
@RandomGeometryDashStuff Ай бұрын
01:07:20 out of bounds 0.0 is not correct when: grad is 1x2 table: { {1.0}, {1.0} } after your algorithm dp is: { {1.0}, {1.0} } but dp should be: { {1.0}, {2.0} } edit: chat noticed 02:24:46
@saiyamjain772
@saiyamjain772 Ай бұрын
when are you doing it in assembly sir ?
@monad_tcp
@monad_tcp 5 күн бұрын
20:41 oh I remember the rant from Acerola, I now always use Oklab instead of that shite
@shizoor
@shizoor Ай бұрын
Excellent work. I've not watched all of it yet but will have to to get my head round your awesome code. Dropping the scale down factor from 2/3 to 1/2 then using it both horizontally and vertically has most hilarious looking effects on pompous right wing politicians.
@NyanCoder
@NyanCoder Ай бұрын
@TsodingDaily 42:23 I'd recommend to just assign the first element's value to min and max
@bibliusz777
@bibliusz777 Ай бұрын
May I ask why you prefer C over Rust?
@hubstrangers3450
@hubstrangers3450 Ай бұрын
Thank you....
@Mufozon
@Mufozon 28 күн бұрын
The problem is that the way you calculate the gradient. The selection then really loves the left most column.
@Dayanto
@Dayanto 18 күн бұрын
He fixed that with the help of chat near the end. The bigger issue is that he made the algorithm completely color blind.
@caiolicinio7018
@caiolicinio7018 Ай бұрын
So why FLT_MAX instead of 0.0 was a problem? 0.0 would make a low gradient on the borders making the algorithm prefer borders ?
@classawarrior
@classawarrior Ай бұрын
Exactly. He was assigning a cost of zero to out-of-bounds pixels, which meant a seam straight down the left or right border of the image would have zero cost. You can see this as a dark area at the sides when he shows dp.png
@skeleton_craftGaming
@skeleton_craftGaming 7 күн бұрын
Well no technically 2005 was not before AI, AI technology dates back to the '70s and '80s
@koktszfung
@koktszfung Ай бұрын
ah so this is how those big eyes memes are made
@user-ec3rm9wr1n
@user-ec3rm9wr1n Ай бұрын
👀
@kossboss
@kossboss Ай бұрын
also now make reverse so it adds pixels and you have stable diffusion
@alexanderkovalev391
@alexanderkovalev391 Ай бұрын
jpeg encoding would be enough but way more faster. png is for pictures with large regions of same pixels like screenshots
@AlameenAdeyemi
@AlameenAdeyemi Ай бұрын
How can i join the discord server?
@jeezusjr
@jeezusjr Ай бұрын
I'm going to rewrite in rust.
@monad_tcp
@monad_tcp 5 күн бұрын
15:44 I still believe in an pure algorithmic approach than statistical/AI. AI is just brute forcing things, it not "intelligent", its actually very stupid. I believe in that so much that I actually have a computing vision company where I'm betting on this. The YOLO algorithm on OpenCV still bets on that, it is not AI, one the best algorithms out there outperform the AI ones, and it is used in the industry because its reliable, AI is not reliable, just like humans. We want computers to be machines, not humans. (although I have an algorithm that I hand optimized that outperforms the last YOLO, its obviously proprietary because I need to pay my bills, sorry)
@hendrikd2113
@hendrikd2113 Ай бұрын
The reason russian government likes Tsoding, is because of him shit talking the NSA.
@RandomGeometryDashStuff
@RandomGeometryDashStuff Ай бұрын
23:25 0xFF000000|(value*0x010101)
@GoodHomeVideos
@GoodHomeVideos Ай бұрын
if (working) twerking = true;
@aqcherprof6985
@aqcherprof6985 Ай бұрын
Привет человек я ваш поклоник 😊. Язык 👅 что ты придумал думую лучше не использовать его без сокращений, в цели соответствии с русским. А так ты крут, подержать тебя у меня пока не получится держись.
@nomadvagabond1263
@nomadvagabond1263 Ай бұрын
best wasted 2hours 36minutes, was all worth it for the last 2 minutes, 2:34:36
@dutchdykefinger
@dutchdykefinger Ай бұрын
it's perfect
@leastexpected3115
@leastexpected3115 Ай бұрын
zozin nooo don't die тwт
@user-ec3rm9wr1n
@user-ec3rm9wr1n Ай бұрын
Not nice joke...
@leastexpected3115
@leastexpected3115 Ай бұрын
@@user-ec3rm9wr1n at the very start he said that he dies
@user-ec3rm9wr1n
@user-ec3rm9wr1n Ай бұрын
@@leastexpected3115 we all going to die one day ......
@leastexpected3115
@leastexpected3115 Ай бұрын
@@user-ec3rm9wr1n :(
@ecosta
@ecosta 19 күн бұрын
I hate to double-comment, but this in action makes me remember when Twitter tried to add something like that with fancy AI stuff - if I recall correctly, someone tested with images containing Obama and Biden and the AI was always removing Obama from the picture. This algorithm is definitely much cheaper than any "modern AI" and works much better.
@rogo7330
@rogo7330 Ай бұрын
I like my data dream linux command (dd if=/dev/null of=/dev/sda)
@user-ec3rm9wr1n
@user-ec3rm9wr1n Ай бұрын
Baba C# ......
@JoseDaviCorreiaPassos
@JoseDaviCorreiaPassos Ай бұрын
First
@doce3609
@doce3609 Ай бұрын
4 views in 37 seconds. Damn you fell off
@petrhoracek8658
@petrhoracek8658 Ай бұрын
52:10 I also say, it is not about programming language, it is about well written libraries and basic knowledge of the problematics
@dickheadrecs
@dickheadrecs Ай бұрын
CASoding
Can C actually do Perfect Bézier Curves?
2:17:22
Tsoding Daily
Рет қаралды 7 М.
I regret doing this...
1:20:07
Tsoding Daily
Рет қаралды 60 М.
NO NO NO YES! (50 MLN SUBSCRIBERS CHALLENGE!) #shorts
00:26
PANDA BOI
Рет қаралды 72 МЛН
Barriga de grávida aconchegante? 🤔💡
00:10
Polar em português
Рет қаралды 60 МЛН
Which one will take more 😉
00:27
Polar
Рет қаралды 83 МЛН
the new PS4 jailbreak is sort of hilarious
12:21
Low Level Learning
Рет қаралды 39 М.
Will Ada Replace C/C++?
44:57
Tsoding
Рет қаралды 68 М.
The runtime that makes Dart tick - Slava Egorov
40:26
Flutter & Friends
Рет қаралды 966
Wait, but Who's Debugging the Debugger?!
59:53
Tsoding Daily
Рет қаралды 33 М.
How Quake Failed their way to Success
21:51
SimonDev
Рет қаралды 128 М.
You don't need Generics in C
1:37:38
Tsoding Daily
Рет қаралды 55 М.
Hiding Data Inside of Executable Files
1:55:14
Tsoding Daily
Рет қаралды 24 М.
X86 Needs To Die
1:09:15
ThePrimeTime
Рет қаралды 345 М.
Why Rust is NOT a Passing Fad...
8:54
Travis Media
Рет қаралды 22 М.
wyłącznik
0:50
Panele Fotowoltaiczne
Рет қаралды 7 МЛН
Распаковка айфона под водой!💦(🎥: @saken_kagarov on IG)
0:20
Взрывная История
Рет қаралды 13 МЛН
Распаковка айфона под водой!💦(🎥: @saken_kagarov on IG)
0:20
Взрывная История
Рет қаралды 13 МЛН
Google I/O 2024 - ИИ, Android 15 и новые Google Glass
22:47