K-means & Image Segmentation - Computerphile

Sdílet
Vložit
  • čas přidán 13. 09. 2016
  • K-means sorts data based on averages. Dr Mike Pound explains how it works.
    Fire Pong in Detail: • Fire Pong Details - Co...
    Deep Dream: • Deep Dream (Google) - ...
    FPS & Digital Video: • FPS & Digital Video - ...
    Dr. Mike's Code:
    % This script is the one mentioned during the Computerphile Image
    % Segmentation video. I chose matlab because it's a popular tool for
    % quickly prototyping things. Matlab licenses are pricey, if you don't have
    % one (or, like me, work for an organisation that does) try Octave as a
    % good free alternative. This code should work in Octave too.
    % Load in an input image
    im = imread('C:\Path\Of\Input\Image.jpg');
    % In matlab, K-means operates on a 2D array, where each sample is one row,
    % and the features are the columns. We can use the reshape function to turn
    % the image into this format, where each pixel is one row, and R,G and B
    % are the columns. We are turning a W,H,3 image into W*H,3
    % We also cast to a double array, because K-means requires it in matlab
    imflat = double(reshape(im, size(im,1) * size(im,2), 3));
    % I specify that initialisation shuold sample points at
    % random, rather than anything complex like kmeans++ initialisation.
    % Kmeans++ takes a long time if you are using 256 classes.
    % Perform k-means. This function returns the class IDs assigned to each
    % pixel, and in this case we also want the mean values for each class -
    % what colour is each class. This can take a long time if the value for K
    % is large, I've used the sampling start strategy to speed things up.
    % While KMeans is running, it will show you the iteration count, and the
    % number of pixels that have changed class since last iteration. This
    % number should get lower and lower, as the means settle on appropriate
    % values. For large K, it's unlikely that we will ever reach zero movement
    % (convergence) within 150 iterations.
    K = 3
    [kIDs, kC] = kmeans(imflat, K, 'Display', 'iter', 'MaxIter', 150, 'Start', 'sample');
    % Matlab can output paletted images, that is, grayscale images where the
    % colours are stored in a separate array. This array is kC, and kIDs are
    % the grayscale indices.
    colormap = kC / 256; % Scale 0-1, since this is what matlab wants
    % Reshape kIDs back into the original image shape
    imout = reshape(uint8(kIDs), size(im,1), size(im,2));
    % Save file out, you need to subtract 1 from the image classes, since once
    % stored in the file the values should go from 0-255, not 1-256 like matlab
    % would do.
    imwrite(imout - 1, colormap, 'C:\Path\Of\Output\Image.png');
    / computerphile
    / computer_phile
    This video was filmed and edited by Sean Riley.
    Computer Science at the University of Nottingham: bit.ly/nottscomputer
    Computerphile is a sister project to Brady Haran's Numberphile. More at www.bradyharan.com

Komentáře • 241

  • @YingwuUsagiri
    @YingwuUsagiri Před 7 lety +493

    Mike is seriously one of my favourites. He's not old-timey so he doesn't clash with Brailsford nor Mr Heartbleed but he's still very technical and it seems like his knowledge is extremely diverse. From imagery to coding to hacking to password stuff (etc. etc.).

    • @palmomki
      @palmomki Před 7 lety +36

      He's my favorite simply because the topics he talks about are stuff I'm more interested in and/or stuff I can understand better - and also I think he's very good at talking.
      For example I'm interested and maybe philosophically armed to understand AIs too, but I find that the guy that talks about that stuff is not as good and entertaining for some reason.

    • @outshimed
      @outshimed Před 7 lety +19

      I like all of the Computerphile presenters, but he's my favorite also.

    • @YingwuUsagiri
      @YingwuUsagiri Před 7 lety

      *****
      He's been in the Arctic lately and still is right now so for Tom to appear would be hard if they didn't pre-record it.

    • @GriffinCalme
      @GriffinCalme Před 7 lety +11

      Agreed, his videos are so in-depth and hands-on. Which is refreshing when most other stuff is extremely high-level and abstract.

  • @qwertyman1511
    @qwertyman1511 Před 7 lety +41

    his neuralnet and learning explanations ,as a collective, blow my mind.

  • @parlaparolequimestco
    @parlaparolequimestco Před 7 lety +128

    I love the video of Dr Mike pound, he explains well and he's entertaining :)

    • @pkermen
      @pkermen Před 7 lety +49

      mike pounding our brains with knowledge

    • @ErikB605
      @ErikB605 Před 7 lety +1

      If every Prof would be like him I could have gotten my degree in half the time :D

  • @jonnypanteloni
    @jonnypanteloni Před 7 lety +1

    I just want to thank Mike Pound and Sean for putting this whole thing together. This has fostered creativity in computers for me and encouraged me to explore more about computers.
    I wouldn't really come here for a classroom, but this sort of short educational video format is really cool!

  • @rian7079
    @rian7079 Před 3 lety +2

    just found this, a week of lecture done in just over 8 minutes. absolutely great explanations from Dr Mike Pound, clear and sound

  • @michaels8297
    @michaels8297 Před 4 lety +1

    bro, ive seen so many videos of smart people try to explain concepts like this and none have come close to how simple and clear you explain it. you've clearly mastered what you are interested in. mucho respecto de los angeles

  • @JohnMichaelson
    @JohnMichaelson Před 7 lety +15

    Something very similar is used in remote sensing for vegetation classification and analysis with multi-band imagery. Train the software on the color and IR signature returns of known vegetation and surface types in a portion of an image and it merrily classifies all the rest.

  • @TrebleWing
    @TrebleWing Před 7 lety +3

    I could listen to Pound for hours

  • @mybigbeak
    @mybigbeak Před 7 lety +1

    This was really clear, and I can see lots of uses for learning this. It makes me want to have a go at writing the k-means method myself.

  • @dvdr14eb
    @dvdr14eb Před 7 lety +69

    You should do a separate channel for this guy

    • @RussellTeapot
      @RussellTeapot Před 7 lety +31

      what channel do you suggest? R, G or B?

    • @Jeremyye0
      @Jeremyye0 Před 7 lety +3

      Yes

    • @RussellTeapot
      @RussellTeapot Před 7 lety +4

      or perhaps A, I keep forgetting the poor alpha channel :(

    • @chestergerez9175
      @chestergerez9175 Před 5 lety +1

      I did watch it again because im loving his voice and i didnt understand at first because again im loving his voice.

    • @robertm6612
      @robertm6612 Před 4 lety

      Yes my mornings consist of scrolling through the long list of computerphile videos looking for the next one of his

  • @-beee-
    @-beee- Před 7 lety

    This finally helped me understand why K-means is relevant in ML and image recognition. Thank you!

  • @Jorgepg1991
    @Jorgepg1991 Před 7 lety +2

    Dr. Mike is amazing at explaining and seems to know a whole lot. Many thanks for the code! Would be great if it was given more often so that we can easily try things at home! :)

  • @lokeshpal396
    @lokeshpal396 Před 3 lety

    Was looking for the explanation only but stayed around because things kept on getting interesting. Nice video.

  • @MrDubidubidubidu
    @MrDubidubidubidu Před 7 lety

    You are the best. I don't know if you already have, but I really hope you go into teaching, your explanations are always crystal clear.

  • @8eck
    @8eck Před 3 lety

    Just wow! Cool stuff, thank you. This helped me to understand it much better. Real life examples helps a lot a well!

  • @TheMeyerchris7
    @TheMeyerchris7 Před 7 lety

    By far the best contributor to Computerphile imho. Not that the others are bad, but every video with this dude is gold.

  • @suponjubobu5536
    @suponjubobu5536 Před 2 lety

    I love these image processing videos.

  • @faisalzia2201
    @faisalzia2201 Před 5 lety

    That was great concept by the way...The same question arises in my mind and explanation is quite good

  • @lewisb8634
    @lewisb8634 Před 7 lety +1

    I'm still confused, but I love listening to Dr Pound! :D

  • @sunnybeta_
    @sunnybeta_ Před 7 lety

    Dr. Mike Pound is the best :D

  • @WolfszeitYT
    @WolfszeitYT Před 7 lety +1

    Great Video, make more videos like this. Mike you are great.

  • @0x8080
    @0x8080 Před 7 lety

    Wow, this totally helps me understand the photoshop magic wand tool, the reason why Star Craft Brood Wars looks the way it does when it gets compressed, and so much more. The implications of this algorithm go so far in common application. Man I love computer science @_@

  • @azmfhqzafarhan
    @azmfhqzafarhan Před 6 lety

    I haven't ever seen such an explanation about anything on the internet!

  • @Squidward1314
    @Squidward1314 Před 7 lety

    More of this guy please! :)

  • @MeriemBounif
    @MeriemBounif Před 7 lety

    Best explanation ever !! Thanks a lot really

  • @juweinert
    @juweinert Před 7 lety

    Yep - super pixel segmentation would be AWESOME! Please do it! :)

  • @comandernehal8567
    @comandernehal8567 Před 3 lety

    Amazing Explanation. Thanks a lot

  • @dolfinsbizou
    @dolfinsbizou Před 7 lety +1

    My god, I've been like "There isn't any computer science channels on CZcams" for so much time, and today I just discover your channel (thanks to e-penser, a French youtuber, who presented your channel in his last video) with this video that speaks of kmeans, a clustering algorithm I used in a recent research internship for my studies. :o

    • @lewismassie
      @lewismassie Před 7 lety

      Have fun binge-watching all the videos!

  • @bhuvaneshs.k638
    @bhuvaneshs.k638 Před 6 lety

    One of the best channel

  • @onyinyechichukwuma689
    @onyinyechichukwuma689 Před 3 lety

    Just wonderful.

  • @pleasedontsubscribeme4397

    wow, great explanation

  • @PatrickChoi
    @PatrickChoi Před 3 lety +1

    I like the video style/angle. Kind of like we are some third person in an interview or sth

  • @adelarscheidt
    @adelarscheidt Před 7 lety

    Great video!

  • @scheimong
    @scheimong Před 7 lety +6

    Hi, I wonder if you can do a video on polygon collision algorithm? I was working on a project lately, and I was finding this issue extremely troublesome. Basically you know the vertices' coordinates of two polygons on a plane and need to check whether they collide and if so, determine their new speed and direction based on their original momentum.

  • @chameerajananjayawijethung5052

    Quite entertaining. thanks a lot.

  • @NotTheDevGames
    @NotTheDevGames Před 7 lety

    I'm not sure when you started doing 50fps but thank you so so so much.

  • @CorvanEssen
    @CorvanEssen Před 7 lety +3

    I actually did this once because.... well... I thought it was fun. I also used the XKCD color names so it would tell me the colors, salmon and baby puke i.e. :)

  • @DaffyDaffyDaffy33322
    @DaffyDaffyDaffy33322 Před 7 lety

    This is very interesting. Could you do a video on dithering? That seems like it would fit this topic, and it's a very interesting subject.

  • @diegobaca2222
    @diegobaca2222 Před 7 lety

    where was this video 6 months ago when i needed to understand this properly!!!

  • @user-xn4lw5ux2i
    @user-xn4lw5ux2i Před 7 lety

    thanks for the code!

  • @jesusvl91
    @jesusvl91 Před 7 lety +1

    Great video as always! Then what happens when you don't know the number of groups you may have in the image/dataset and you need to find the most different ones between each other? What algorithm should be used in this case? I would really appreciate a video about it. Thank you!

  • @TechXSoftware
    @TechXSoftware Před 7 lety

    I'm learning that for Social Web analytics for UNI.

  • @MrTridac
    @MrTridac Před 7 lety

    Yay, Mike!

  • @cashphattichaddi
    @cashphattichaddi Před 7 lety

    Awesome!

  • @TorreyBraman
    @TorreyBraman Před 7 lety

    I love this channel.. =)

  • @abdelrhmanrhyaseen6194

    wonderful

  • @harrywang6792
    @harrywang6792 Před 3 lety

    you explained it better than my professor ever can

  • @Ethernet3
    @Ethernet3 Před 7 lety

    Love the comments in the matlab script

  • @kwinvdv
    @kwinvdv Před 7 lety +16

    Would the biggest n peaks in the fft of an image also be a good initial guess for the means?

    • @psuedoFRE4K
      @psuedoFRE4K Před 7 lety +1

      Bump. It seems like a good way of doing it, interested to know the answer.

    • @AR-dx9zp
      @AR-dx9zp Před 7 lety +1

      very interesting question !!

  • @skit555
    @skit555 Před 7 lety

    Really cool :)

  • @travisbonneau
    @travisbonneau Před 6 lety

    This guy always reminds me of one of my high school computer science teachers, but then the voice is just so different

  • @cyril021944
    @cyril021944 Před 7 lety +8

    Is this technique used to automaticly select objects in programs like photoshop (magic wand or something like that) ?

    • @furrane
      @furrane Před 7 lety +5

      You might want to look at a previous video he did about edge detection ;)

    • @DeMizeM4dness
      @DeMizeM4dness Před 7 lety +3

      They typically use a zero crossing algorithm to detect edges.

  • @Faxter313
    @Faxter313 Před 7 lety

    Good video, well explained.
    Can you do this with OpenCV as easily as in Matlab?

  • @Eskermo
    @Eskermo Před 7 lety

    T'would be quite nice if the GNU site (or even just the Octave part) were available. Hopefully they can get the site up soon.

  • @ForbinKid
    @ForbinKid Před 7 lety +3

    A bit of randomness with natural selection. I think I've heard that before somewhere.

  • @TylerMatthewHarris
    @TylerMatthewHarris Před 6 lety

    Please more from him

  • @SnowmansApartment
    @SnowmansApartment Před 4 lety

    is supersegmentation what you can use to ‚select‘ regions of an image like quick select in photoshop?

  • @MAlgMAlg1
    @MAlgMAlg1 Před 7 lety

    Next time, consider putting the code in a separate link. It makes the description
    nicer and easier to read!

  • @rikschaaf
    @rikschaaf Před 7 lety +10

    If I remember correctly, k-means uses euclidean distance for finding out in which group the data points should be.
    Does this mean that if you are not careful, the dimension with the largest values will influence the clusters the most? How do you correct for this? Do you scale the values of the dimension dependent on its range or are there better method?

    • @Birkirrey
      @Birkirrey Před 7 lety +1

      This is a point of debate and there are several approaches. You could scale the dimensions but there are also distance measures that take scales into account, such as Mahalanobis distance.

    • @Peacemaker957
      @Peacemaker957 Před 7 lety

      Yes you can scale all dimensions to the same range, which is a popular approach I believe. For stuff like physical data which was measured, errors can occur which are called outliers, those are usually removed before clustering as well. There are also mechanisms to automatically detect outliers.

    • @rikschaaf
      @rikschaaf Před 7 lety

      +Peacemaker957 In that case wouldnt it be better to scale using the standard deviation? It dampens the effect of outliers

    • @muesk3
      @muesk3 Před 7 lety

      Would single-linkage clustering also avoid this problem?

    • @rikschaaf
      @rikschaaf Před 7 lety +1

      +Chiel Single linkage clustering wouldn't avoid this problem, as it is also dependent in euclidean distance. If this distance isn't calibrated correctly, it could still be that certain variables have to big of an impact due to their large differences in values.

  • @numbolokenshindo1727
    @numbolokenshindo1727 Před 4 lety

    Gotta respect the fact that he's got a copy of Elements of Statistical Learning on the bookshelf.

  • @toastersman217
    @toastersman217 Před 5 lety

    I have a question. Why are the quantized images (the ones with less colours) are taking less space? It is because the pixels are saved with pointers (less colors => less centroids to save) and pointers take almost no space compare to a color/centroid? In the case that I described, a non-quantized image requires a color/centroid for every pixel. Thus, it would take a lot of space.

  • @selvakarna6264
    @selvakarna6264 Před 5 lety

    Can you give a explanation of Gray scale pixel segmentation? 2D?

  • @Brutaltronics
    @Brutaltronics Před 7 lety

    lol, the matlab script is so simple. Dr Mike ftw.

  • @musabara6269
    @musabara6269 Před 7 lety

    Hi, do you have a video on K-means implementation in MATLAB? I need help on it please

  • @furrane
    @furrane Před 7 lety +59

    What does K mean ?

  • @ciclis6289
    @ciclis6289 Před 7 lety

    The original image is in a n x m x 3 uint8 image and the compressed kmeans solution is an n x m uint8 image.
    How would I extract the separate R, G, and B channels of the k-means solution image?

  • @dheerajahuja9478
    @dheerajahuja9478 Před 7 lety

    Hi,
    it was indeed a nice explaination. I have one question though is does this algo work on numbers only? What if say I have thousands on images and I want to segregate those in different types.. does K-mean suits here?

  • @2Cerealbox
    @2Cerealbox Před 7 lety

    This would make a good transition into SVMs.

  • @jan861
    @jan861 Před 4 lety +1

    Can you do something about Image Registration and warp matrices, please?

  • @pretendawatch
    @pretendawatch Před 7 lety +7

    What is the point in those shelves?

    • @amber1862
      @amber1862 Před 6 lety +3

      Champagne Stegosaur To encourage CZcamsrs to comment on said useless shelves; this increases the channel's user engagement ratings. It's all calculated, you cannot trust these guys.

  • @TheAGCteam
    @TheAGCteam Před 7 lety

    I love this guy.
    His bookshelf is way too empty though.

  • @JonnyRobbie
    @JonnyRobbie Před 7 lety +5

    I'm having trouble understanding (in the image case), what are exactly the variables and what are the samples?

    • @palmomki
      @palmomki Před 7 lety +3

      I think pixels are seen as discrete points in a 3-dimensional space with axes R,G,B, I don't know if this answers your questions.
      So there's a map that links every pixel of the image to a 3D point. The k-mean calculation of "distances" as he drew them is performed in the space of colors, and then the result is applied to the pixels in the image.

    • @quitteable
      @quitteable Před 7 lety

      x,y,R,G,B gives you 5 dimensions

    • @CJSwitz
      @CJSwitz Před 7 lety +5

      Every pixel is a data point (one of the Xs on his chart), plotted on 3 axis, Red, Green, and Blue. The K-value is the number of groups (the little sliding cards on his charts) the algorithm clusters those data points into. No "spatial" information is used, a pixel in the top left of the image can be clustered with a pixel on the bottom right. It only cares about colour similarity.

    • @arirahikkala
      @arirahikkala Před 7 lety +7

      I don't think I would have understood this video without having earlier familiarity with k-means and color quantization. Switzer explained it well, but to try to give a bit of extra help regardless: What we do with the image example is that we place each pixel's color in a three-dimensional color cube and thus get a point cloud, find the mean colors of k clusters in that cloud, and recolor the image by replacing each pixel's color with the mean color of its cluster.
      Well, multiple pixels can have the same color, so what we're actually doing is making a histogram rather than a point cloud, or maybe making a point cloud where each point is weighed according to how many pixels have that color. Not sure exactly what nomenclature they use in the most popular practical implementations of this. The important thing for understanding what's going on is that we throw out all spatial information when we go from pixels on the image to points in the color cube.
      Also, I mentioned that the color cube is three-dimensional, which it most likely is, but of course it might be in some different color space than RGB. A color space with better perceptual uniformity might give better results (or might not, I'm not too familiar with this fied).

    • @DaniFazeres
      @DaniFazeres Před 7 lety

      I understood the video after reading your comment.

  • @kuqiu5003
    @kuqiu5003 Před rokem

    Can you also talk about other clustering algorithms like density based ones? Mean Shift and DBSCAN?

  • @fet1612
    @fet1612 Před 5 lety +1

    03:13
    Is it possible they could get it completely wrong? Good question, yes.

  • @naheliegend5222
    @naheliegend5222 Před 6 lety

    I have a question: if we got random data and we want to split them into 2 sections, do we how why the algorithm put this single datapoint p_i into section 1 or section 2 ?

  • @janismac314
    @janismac314 Před 7 lety +2

    Video suggestion: SIFT Algorithm (for dummies)

  • @siluverukirankumar9954

    First of all thanks for the video.
    HOW CAN WE SAY THAT RGB IMAGE IS ?-MEANS CLUSTERED IMAGE... I mean if given rgb image what is the possibility of k-means clustering value, is there any maximum and minimum limit there .... please explain...

  • @Rithesh_NJ
    @Rithesh_NJ Před 7 lety

    Is this how the histogram is displayed on my camera or on photoshop?

  • @hypercortical7772
    @hypercortical7772 Před 4 lety

    so if i'm understanding this right, it's an algorithm that takes two points among data, takes the mean of all the data points within a certain range of each point, moves the point to that mean data point, and then keeps doing this over and over again until... what until there are no more new means for the point to move to? and then that is the "ideal mean"?

  • @CashewOCE
    @CashewOCE Před 7 lety +3

    So would this be done through recursion?
    Love me some Mike

    • @remuladgryta
      @remuladgryta Před 7 lety +3

      Since any iterative algorithm can be transformed into a recursive one and vice versa, yes! In fact, any system that is Turing complete (en.wikipedia.org/wiki/Turing_completeness) can be transformed into any other.

    • @basimkhajwal2896
      @basimkhajwal2896 Před 7 lety +1

      Not really, calculating it is an iterative process which doesn't really need recursion. Although if you want to write a recursive function anyway you can do.

    • @CashewOCE
      @CashewOCE Před 7 lety +1

      Thanks for the link man! This is a very interesting read!

    • @remuladgryta
      @remuladgryta Před 7 lety +2

      Trivially, you can rewrite any iterative algorithm
      with a recursive one, e.g:
      >def iterative(input):
      > DATA = input
      > while not should_halt(DATA):
      > update_data(DATA)
      > return DATA
      becomes:
      >def recursive(input):
      > DATA = input
      > update_data(DATA)
      > if should_halt(DATA):
      > return DATA
      > else:
      > return recursive(DATA)
      Which should work for any iterative algorithm (barring any mistakes I've made) but is a naive solution and generally terribly inefficient (will take up lots more memory) if the problem isn't well suited for it.
      Converting the other way (from recursion to iteration) is a bit more involved, but it's what your computer does every time it compiles (or interprets) a recursive program and it involves using stack frames.
      After all, a computer really only follows one iterative algorithm:
      1: read an instruction located at P
      2: perform the instruction
      3: change P to be the next instruction
      4: repeat from step 1.
      EDIT: Indentation

  • @usamaahmad294
    @usamaahmad294 Před rokem

    Hi Every one i have a problem in segmentation and the problem is i want to segment the zoning map image but in our case the output classes are unknown.Any one who suggests me a segmentation model which works better for the zoning map images

  • @jasonbikeracer1
    @jasonbikeracer1 Před 7 lety

    could you use this to detect stego

  • @akshatsingh6036
    @akshatsingh6036 Před 2 lety

    He is saying we are compressing image with k means and using a limited amount of colors but there will be still 3 channels and they all are integers so how the image is compressing.

  • @smeagol1414
    @smeagol1414 Před 7 lety

    You should open a github repository with the codes from all the videos, would make it a lot easier to get them.

  • @JmanNo42
    @JmanNo42 Před 7 lety

    Could one train an AI to calculate the timesignature and tempo of a music track?

  • @mostinho7
    @mostinho7 Před 6 lety +2

    Does Dr Mike know everything?

  • @edskev7696
    @edskev7696 Před 7 lety

    So for spatial clustering also you just go to 5d? R g b x y? I don't know how you'ld construct a metric on that space though.

    • @edskev7696
      @edskev7696 Před 7 lety

      Wouldn't you just weight the various things differently, so have a diagonal matrix A and use ||x|| = sqrt (xAx), with two values in A, one for space and the other for colour?

  • @hanssondaniel
    @hanssondaniel Před 7 lety

    Are the pixels clustered in 3D? I would like to try this in HSL colour space, in order to find dominant colors and split up an image into arbitrary channels. Has this been done before? Any links with guides on how to get started?

    • @RussellTeapot
      @RussellTeapot Před 7 lety +1

      yes, from what I understood the pixels are indeed clustered in 3D, one for each channel (R,G,B), so it should be the same for HSL... About links, he provided a link for a MATLAB implementation, maybe you should read that and try to figure out the process.

    • @hanssondaniel
      @hanssondaniel Před 7 lety

      Thank you! I'll have a look at that link.

  • @Sheepyhead
    @Sheepyhead Před 7 lety +2

    He needs some more books D:

  • @MakerTim
    @MakerTim Před 7 lety +2

    The Rubicscube is solved \o/

  • @hellowill
    @hellowill Před 6 lety

    Can you do video on mapreduce?

  • @CharitarthVyas
    @CharitarthVyas Před 5 lety

    Would be nice to see watershed algorithm using python.

  • @guytoob
    @guytoob Před 7 lety

    Nice explanation but found the title a bit misleading because segmentation by itself commonly refers to spatial segmentation. A better title would have said posterisation of images using k-means.

  • @DrRChandra
    @DrRChandra Před 7 lety

    Based on the title, I thought initially this was going to be about 1000 vs 1024, KB vs KiB :-)

  • @rich1051414
    @rich1051414 Před 7 lety +10

    2D image = A page.
    3D image = A book.
    4D image = A bookcase.
    5D image = A library.
    If you NEED a visualization.

    • @tedchirvasiu
      @tedchirvasiu Před 7 lety +7

      Libraries are 5D confirmed.

    • @blacklistnr1
      @blacklistnr1 Před 7 lety +2

      You're not quite making it past a book. On the page, you can actually pick any point on it, making it a continuous space. However, you can't pick library 2.55, bockcase pi, book sqrt(2). This would become quite an annoyance when an optimal position is in between books/libraries.
      Yet another case when books fail to impress me. #NOCtrlF

    • @rich1051414
      @rich1051414 Před 7 lety +4

      blacklistnr1 But book 2.5 = halfway into the third book. Bookshelf 2.5 = the middle of the third bookshelf. You would have to compress it all down into a continuous space, which would be a nightmare for humans to attempt to browse, but it gets the point across. To look it as a multidimensional array named library:
      library[][][][][]

    • @DanielBeecham
      @DanielBeecham Před 7 lety

      It doesn't have to be continuous (complete) though... and you can do discrete optimization. I guess it depends on your definition of "dimension"... Vector spaces are built on top of fields, so "of course" they are complete, but somehow 2 dimensional matrices and arrays are also of 2 dimensions, but they are very discrete and very finite...

  • @slpk
    @slpk Před 7 lety

    I thought you were talking about spacial grouping until you said that spacial grouping was going to be another episode...

  • @PixelOutlaw
    @PixelOutlaw Před 7 lety

    I bet it works even better using HSL color model.

    • @CJSwitz
      @CJSwitz Před 7 lety

      In theory, it should produce the exact same results. HSB, RGB, CMYK, etc. are just ways of describing colours with numbers. Changing the colourspace doesn't effect the way the colours relate to one another, or at least it ideally shouldn't.

    • @PixelOutlaw
      @PixelOutlaw Před 7 lety +1

      You may describe colors in many ways but RGB and HSL work very differently in the same operations. Interpolation between red and blue in RGB for example will give you a nice pink, however interpolation between red and blue in HSL will give you yellow, green, or cyan depending on the percentage between both extremes. Maybe you could use K-means with a color divided into RGB and HSL values to get an even closer approximate than simply 1 color model.

    • @PixelOutlaw
      @PixelOutlaw Před 7 lety +1

      Edit, sorry I call fuchsia pink. Pink is kind of a horrible color because it can mean very different things depending on culture. I guess "light purple" might be a better name.
      Because the colors I mentioned before are between the other hues in the Hue component of the HSL model. This is why the color model you use matters when applying interpolation. Different color models are concerned with different aspects of color. So using different components to define color gives very different results when applying algorithms designed for RGB color space. If you look at hue being a rainbow circle you'll see red at 0 degrees and blue at 240 degrees. The middle 120 degrees is a green hue, while 60 degrees is yellow and 180 is cyan. Just look up the model it's easier to understand. My point is, you can't apply the algorithms designed for one color space to the components of another color space and expect them to produce the desired results. They'll be mathematically correct for the color space given but may not be correct to your perception of color mixing.

    • @fgdgjgjhc
      @fgdgjgjhc Před 7 lety +1

      With K-Means, the representation of the data actually plays an important role. As a textbook example, just imagine two concentric rings with a large difference in diameter. While the two clusters can easily be separated by humans, k-means will fail horribly, because the means of both clusters are exactly the same. Now imagine you were to recode the data in terms of distance from the centerpoint and angle of each point. As with HSL and RGB, both the first dataset and the second dataset are describing the same data, just in different representation. However, now the two clusters are easy to separate using k-mean, it actually only needs the distance variable, which is different for each of the clusters.
      So while HSL, RGB and CMYK are all different ways of describing or encoding the same colors, encoding does matter a lot when K-Means is used. This actually true for most data analysis methods. A bad encoding of the data can turn a simple problem into an impossible one.

  • @xPROxSNIPExMW2xPOWER
    @xPROxSNIPExMW2xPOWER Před 7 lety +1

    More videos ON CUDA, maybe on how to successfully install it without sending my machine into a Kernel Panic and having to reformat and re-flash a new image every damn time shitttt

  • @gijsvandelagemaat1604
    @gijsvandelagemaat1604 Před 7 lety

    is this what PowerPoint uses when removing the background of an image?

  • @klyanadkmorr
    @klyanadkmorr Před 3 lety +1

    Waiting for the day some naughty researcher tech names a filter a 'Cluster FCK' ☺