title
11.7: Computer Vision: Blob Detection - Processing Tutorial

description
In this computer vision tutorial, I build on top of the color tracking example and demonstrate a technique known as "blob detection" to track multiple objects of the same color. Support this channel on Patreon: https://patreon.com/codingtrain Send me your questions and coding challenges! Contact: https://twitter.com/shiffman Links discussed in this video: Computer Vision for Artists and Designers by Golan Levin: http://www.flong.com/texts/essays/essay_cvad/ Image Processing in Computer Vision: http://openframeworks.cc/ofBook/chapters/image_processing_computer_vision.html Source Code for the Video Lessons: https://github.com/CodingTrain/Rainbow-Code p5.js: https://p5js.org/ Processing: https://processing.org For More Computer Vision videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6aG2RJHErXKSWFDXU4qo_ro For More Coding Challenges: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH Help us caption & translate this video! http://amara.org/v/QbrM/ 📄 Code of Conduct: https://github.com/CodingTrain/Code-of-Conduct

detail
{'title': '11.7: Computer Vision: Blob Detection - Processing Tutorial', 'heatmap': [{'end': 309.476, 'start': 225.24, 'weight': 0.742}, {'end': 585.014, 'start': 566.669, 'weight': 0.786}, {'end': 874.238, 'start': 810.748, 'weight': 0.877}, {'end': 900.159, 'start': 885.19, 'weight': 0.764}], 'summary': 'This tutorial provides an in-depth guide to programming a blob detection algorithm for computer vision, showcasing the process using red cups on a green screen and emphasizing the implementation of blob objects, pixel distance calculation, and real-time modification.', 'chapters': [{'end': 101.808, 'segs': [{'end': 52.618, 'src': 'embed', 'start': 21.169, 'weight': 2, 'content': [{'end': 25.313, 'text': 'Okay, over here that finds this cup that I have taped to my green screen behind me.', 'start': 21.169, 'duration': 4.144}, {'end': 29.136, 'text': 'by looking for the average location of all of the red pixels it finds.', 'start': 25.313, 'duration': 3.823}, {'end': 31.479, 'text': 'And this works perfectly, beautifully, nicely.', 'start': 29.537, 'duration': 1.942}, {'end': 33.04, 'text': "However, there's a problem.", 'start': 31.779, 'duration': 1.261}, {'end': 38.605, 'text': 'If I add a second cup, look at the average location is in between those two things.', 'start': 33.861, 'duration': 4.744}, {'end': 43.01, 'text': 'And I want to be able to track them individually as individual blobs.', 'start': 39.006, 'duration': 4.004}, {'end': 47.013, 'text': 'So how do we do that? So I want to talk about how this algorithm works.', 'start': 43.39, 'duration': 3.623}, {'end': 52.618, 'text': "So what's going on here? There is an image that the camera is seeing.", 'start': 47.654, 'duration': 4.964}], 'summary': 'Discusses algorithm for tracking individual objects in images.', 'duration': 31.449, 'max_score': 21.169, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ce-2l2wRqO8/pics/ce-2l2wRqO821169.jpg'}, {'end': 101.808, 'src': 'embed', 'start': 69.834, 'weight': 0, 'content': [{'end': 73.675, 'text': 'Is this red? And you know, you can insert something else there.', 'start': 69.834, 'duration': 3.841}, {'end': 80.397, 'text': 'Is this a bright pixel? Is it a dark pixel? Is it a blue pixel? You know, you could be using a connect and depth tracking.', 'start': 73.915, 'duration': 6.482}, {'end': 84.739, 'text': "Is it a close pixel? Is it a far pixel? There's lots of things you could substitute for this question.", 'start': 80.437, 'duration': 4.302}, {'end': 89.961, 'text': "But for my demonstration of the algorithm, it's going to work nicely if I ask, is it red? And so the answer is going to be no.", 'start': 84.779, 'duration': 5.182}, {'end': 91.121, 'text': 'Is it red? No.', 'start': 90.441, 'duration': 0.68}, {'end': 91.942, 'text': 'Is it red? No.', 'start': 91.361, 'duration': 0.581}, {'end': 92.642, 'text': 'Is it red? No.', 'start': 92.082, 'duration': 0.56}, {'end': 93.202, 'text': 'No No.', 'start': 92.842, 'duration': 0.36}, {'end': 94.743, 'text': "It's a very negative program.", 'start': 93.222, 'duration': 1.521}, {'end': 96.924, 'text': 'No, no, no, no, no, no, no, no, no, no, no, no, no, no, no, no.', 'start': 94.803, 'duration': 2.121}, {'end': 101.808, 'text': 'But eventually, at some point, da, da, da, da, da, da, da, da, da, It gets to over here.', 'start': 97.404, 'duration': 4.404}], 'summary': 'Demonstration of algorithm with negative responses, eventually reaching a certain point.', 'duration': 31.974, 'max_score': 69.834, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ce-2l2wRqO8/pics/ce-2l2wRqO869834.jpg'}], 'start': 0.349, 'title': 'Blob detection algorithm', 'summary': 'Provides a tutorial on programming a blob detection algorithm for computer vision, addressing the need to track individual blobs and demonstrating the process using red cups taped to a green screen.', 'chapters': [{'end': 101.808, 'start': 0.349, 'title': 'Blob detection algorithm', 'summary': 'Provides a tutorial on programming a blob detection algorithm for computer vision, addressing the need to track individual blobs and demonstrating the process using red cups taped to a green screen.', 'duration': 101.459, 'highlights': ['The algorithm aims to detect individual blobs by analyzing the average location of specific colored pixels, addressing the limitation of tracking multiple objects as a single entity.', 'The tutorial involves breaking down the process of identifying pixels of a certain color, such as red, to determine the presence of individual blobs, highlighting the iterative nature of the algorithm.', 'The speaker humorously illustrates the application of the algorithm using taped plastic cups on a green wall, emphasizing the practical implementation of the programming tutorial.']}], 'duration': 101.459, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ce-2l2wRqO8/pics/ce-2l2wRqO8349.jpg', 'highlights': ['The algorithm aims to detect individual blobs by analyzing the average location of specific colored pixels, addressing the limitation of tracking multiple objects as a single entity.', 'The tutorial involves breaking down the process of identifying pixels of a certain color, such as red, to determine the presence of individual blobs, highlighting the iterative nature of the algorithm.', 'The speaker humorously illustrates the application of the algorithm using taped plastic cups on a green wall, emphasizing the practical implementation of the programming tutorial.']}, {'end': 499.866, 'segs': [{'end': 129.35, 'src': 'embed', 'start': 102.189, 'weight': 0, 'content': [{'end': 105.819, 'text': "Is it red? It's like, yes, yes, it's red.", 'start': 102.189, 'duration': 3.63}, {'end': 110.141, 'text': "So if it's red, then we have to ask the question Is it??", 'start': 106.1, 'duration': 4.041}, {'end': 112.202, 'text': 'Did I find a red pixel before??', 'start': 110.541, 'duration': 1.661}, {'end': 113.023, 'text': 'Or is this a new??', 'start': 112.222, 'duration': 0.801}, {'end': 115.003, 'text': 'Have I found the first red pixel??', 'start': 113.123, 'duration': 1.88}, {'end': 119.606, 'text': 'And as soon as it finds the first red pixel, it has to make a blob.', 'start': 115.564, 'duration': 4.042}, {'end': 125.148, 'text': 'So the blob is going to be a Java class, an object, which is a blob.', 'start': 119.886, 'duration': 5.262}, {'end': 129.35, 'text': "It's going to say, ah, I found the first red pixel, so I'm making a blob object.", 'start': 125.328, 'duration': 4.022}], 'summary': 'Identifying and creating a blob object upon finding the first red pixel.', 'duration': 27.161, 'max_score': 102.189, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ce-2l2wRqO8/pics/ce-2l2wRqO8102189.jpg'}, {'end': 182.889, 'src': 'embed', 'start': 150.47, 'weight': 2, 'content': [{'end': 153.252, 'text': "So let's just put it in blob A, and maybe blob A gets a little wider.", 'start': 150.47, 'duration': 2.782}, {'end': 154.272, 'text': 'Then it looks for the next pixel.', 'start': 153.352, 'duration': 0.92}, {'end': 155.332, 'text': "Oh, it's near blob A.", 'start': 154.332, 'duration': 1}, {'end': 155.853, 'text': 'Put it in blob A.', 'start': 155.332, 'duration': 0.521}, {'end': 156.673, 'text': 'Make it a little wider.', 'start': 155.853, 'duration': 0.82}, {'end': 157.133, 'text': 'It keeps going.', 'start': 156.693, 'duration': 0.44}, {'end': 158.214, 'text': 'Then it says, no, no, no, no, no.', 'start': 157.153, 'duration': 1.061}, {'end': 158.834, 'text': 'Finds another one.', 'start': 158.394, 'duration': 0.44}, {'end': 159.634, 'text': "Oh, it's part of blob A.", 'start': 158.894, 'duration': 0.74}, {'end': 160.395, 'text': 'No, no, no, no, no, no, no.', 'start': 159.634, 'duration': 0.761}, {'end': 161.875, 'text': 'And eventually it gets on here, and it finds another blob A.', 'start': 160.575, 'duration': 1.3}, {'end': 164.817, 'text': 'Yes Well, is it near blob A? And it suddenly realizes, no.', 'start': 161.875, 'duration': 2.942}, {'end': 166.057, 'text': 'Look at that.', 'start': 165.697, 'duration': 0.36}, {'end': 169.039, 'text': 'That distance is greater than some threshold.', 'start': 166.337, 'duration': 2.702}, {'end': 171.701, 'text': "It's time for me to make another blob.", 'start': 169.7, 'duration': 2.001}, {'end': 180.767, 'text': "So it's looking for all the red pixels and finding the clusters of red pixels near each other that are far enough by some threshold amount.", 'start': 172.181, 'duration': 8.586}, {'end': 182.889, 'text': "So that's the algorithm we need to program.", 'start': 181.068, 'duration': 1.821}], 'summary': 'Algorithm identifies clusters of red pixels by distance threshold to create blobs.', 'duration': 32.419, 'max_score': 150.47, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ce-2l2wRqO8/pics/ce-2l2wRqO8150470.jpg'}, {'end': 309.476, 'src': 'heatmap', 'start': 225.24, 'weight': 0.742, 'content': [{'end': 229.682, 'text': "okay, great, so that's what happens when I first make the blob.", 'start': 225.24, 'duration': 4.442}, {'end': 231.944, 'text': "oops, now let's think about this.", 'start': 229.682, 'duration': 2.262}, {'end': 237.927, 'text': "so now let's go back to this algorithm, and I don't need what do I need?", 'start': 231.944, 'duration': 5.983}, {'end': 243.571, 'text': 'hmm, I need to have some sort of variable list of blobs.', 'start': 237.927, 'duration': 5.644}, {'end': 250.512, 'text': "So I'm going to make an array list of blob objects.", 'start': 247.97, 'duration': 2.542}, {'end': 254.075, 'text': "Now, if array lists are new to you, it's like a flexibly sized array.", 'start': 250.552, 'duration': 3.523}, {'end': 256.938, 'text': 'So I can start with none, and I can add more, and that sort of thing.', 'start': 254.316, 'duration': 2.622}, {'end': 260.281, 'text': 'And this is something that I encourage you to look into.', 'start': 257.197, 'duration': 3.084}, {'end': 269.848, 'text': "And one thing that I'm going to have to do is say, Blobs.clear.", 'start': 261.101, 'duration': 8.747}, {'end': 272.729, 'text': "So this is something that's going to be really, really key.", 'start': 270.728, 'duration': 2.001}, {'end': 274.489, 'text': "And I'm going to bring this up again later.", 'start': 272.749, 'duration': 1.74}, {'end': 283.611, 'text': 'But what this algorithm is going to do is just show me a snapshot of blobs at this moment in time and then a snapshot of blobs at the next moment in time.', 'start': 274.529, 'duration': 9.082}, {'end': 285.631, 'text': "But it's not going to know which blob is which over time.", 'start': 283.631, 'duration': 2}, {'end': 287.052, 'text': "But I'm going to get to that in a future video.", 'start': 285.651, 'duration': 1.401}, {'end': 288.612, 'text': "We'll talk more about that in a little bit.", 'start': 287.072, 'duration': 1.54}, {'end': 290.753, 'text': "So I don't need this average location anymore.", 'start': 288.972, 'duration': 1.781}, {'end': 291.553, 'text': "I don't need this count.", 'start': 290.773, 'duration': 0.78}, {'end': 293.153, 'text': 'This is all from my previous example.', 'start': 291.593, 'duration': 1.56}, {'end': 302.335, 'text': "But what I'm doing here is what happens Soon, as I find a pixel that meets this red threshold.", 'start': 293.993, 'duration': 8.342}, {'end': 309.476, 'text': "well, What I need to do, what I'm going to do, is just say blob B is a new blob at that particular x and y,", 'start': 302.335, 'duration': 7.141}], 'summary': 'Creating an array list of blob objects for flexible storage and manipulation.', 'duration': 84.236, 'max_score': 225.24, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ce-2l2wRqO8/pics/ce-2l2wRqO8225240.jpg'}, {'end': 349.628, 'src': 'embed', 'start': 317.137, 'weight': 3, 'content': [{'end': 321.498, 'text': "only. I don't always make a new blob, right, I only make a new blob.", 'start': 317.137, 'duration': 4.361}, {'end': 323.038, 'text': 'well, when would I make a new blob?', 'start': 321.498, 'duration': 1.54}, {'end': 330.913, 'text': 'if blobs is empty, Then I make a new blob right.', 'start': 323.038, 'duration': 7.875}, {'end': 334.977, 'text': 'so if there are no blobs and I found a pixel, it has to be now.', 'start': 330.913, 'duration': 4.064}, {'end': 339.38, 'text': "otherwise And I'm going to do this in a slightly different way.", 'start': 334.977, 'duration': 4.403}, {'end': 346.005, 'text': 'but another way that I could do that is for every blob.', 'start': 339.38, 'duration': 6.625}, {'end': 349.628, 'text': "Let's add a boolean variable saying found is false.", 'start': 346.005, 'duration': 3.623}], 'summary': "Creating a new blob when 'blobs' is empty, else adding a boolean variable 'found' for every blob.", 'duration': 32.491, 'max_score': 317.137, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ce-2l2wRqO8/pics/ce-2l2wRqO8317137.jpg'}], 'start': 102.189, 'title': 'Blob detection algorithm', 'summary': "Introduces the process of detecting clusters of red pixels to form 'blobs' by analyzing their proximity and using threshold distance, with the goal of implementing a java class for each blob. it also provides insights into implementing a blob detection algorithm, emphasizing the creation of blob objects, utilizing array lists, determining blob proximity, and identifying the center of a blob.", 'chapters': [{'end': 225.24, 'start': 102.189, 'title': 'Blob detection algorithm', 'summary': "Introduces the process of detecting clusters of red pixels to form 'blobs' by analyzing their proximity and using threshold distance, with the goal of implementing a java class for each blob.", 'duration': 123.051, 'highlights': ["The chapter introduces the process of detecting clusters of red pixels to form 'blobs' by analyzing their proximity and using threshold distance. The algorithm aims to identify clusters of red pixels near each other that are far enough by some threshold amount.", 'The goal of implementing a Java class for each blob is emphasized. The blobs are represented by Java classes, each containing properties such as x, y, width, and height, essentially forming rectangles to encapsulate the clusters of red pixels.', "The process involves iterating through pixels, checking for their color, and determining their proximity to existing blobs. The algorithm involves iteratively checking pixels for their color, and if they are near an existing blob, they are added to it, potentially expanding the blob's dimensions."]}, {'end': 499.866, 'start': 225.24, 'title': 'Blob detection algorithm', 'summary': 'Provides insights into implementing a blob detection algorithm, emphasizing the creation of blob objects, utilizing array lists, determining blob proximity, and identifying the center of a blob.', 'duration': 274.626, 'highlights': ['Creation of Blob Objects using Array Lists The algorithm involves creating an array list of blob objects, enabling the flexibility to start with none and add more as needed.', 'Identification of Blob Proximity The process entails determining the distance between a specific xy point and a blob, with the objective of identifying if the point is near the center of the blob.', 'Calculation of Blob Center The algorithm demonstrates the calculation of the center of a blob by utilizing the x and y coordinates along with the width and height parameters.']}], 'duration': 397.677, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ce-2l2wRqO8/pics/ce-2l2wRqO8102189.jpg', 'highlights': ["The process involves iterating through pixels, checking for their color, and determining their proximity to existing blobs. The algorithm involves iteratively checking pixels for their color, and if they are near an existing blob, they are added to it, potentially expanding the blob's dimensions.", 'The goal of implementing a Java class for each blob is emphasized. The blobs are represented by Java classes, each containing properties such as x, y, width, and height, essentially forming rectangles to encapsulate the clusters of red pixels.', 'Creation of Blob Objects using Array Lists The algorithm involves creating an array list of blob objects, enabling the flexibility to start with none and add more as needed.', 'Identification of Blob Proximity The process entails determining the distance between a specific xy point and a blob, with the objective of identifying if the point is near the center of the blob.', 'Calculation of Blob Center The algorithm demonstrates the calculation of the center of a blob by utilizing the x and y coordinates along with the width and height parameters.', "The chapter introduces the process of detecting clusters of red pixels to form 'blobs' by analyzing their proximity and using threshold distance. The algorithm aims to identify clusters of red pixels near each other that are far enough by some threshold amount."]}, {'end': 950.723, 'segs': [{'end': 530.209, 'src': 'embed', 'start': 500.166, 'weight': 3, 'content': [{'end': 507.94, 'text': 'So I want to know if that pixel is within some distance.', 'start': 500.166, 'duration': 7.774}, {'end': 516.749, 'text': "Now, again, let's use distance squared to like, oh, don't I have distance squared in this example? Right here.", 'start': 508.541, 'duration': 8.208}, {'end': 517.53, 'text': 'There it is.', 'start': 517.169, 'duration': 0.361}, {'end': 521.953, 'text': "Oh, but it's only, that's a 3D distance.", 'start': 517.73, 'duration': 4.223}, {'end': 523.515, 'text': "Let's make a 2D version of it.", 'start': 522.075, 'duration': 1.44}, {'end': 530.209, 'text': 'I have this from a previous example where I was using color.', 'start': 524.617, 'duration': 5.592}], 'summary': 'Determining distance of a pixel, converting 3d to 2d', 'duration': 30.043, 'max_score': 500.166, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ce-2l2wRqO8/pics/ce-2l2wRqO8500166.jpg'}, {'end': 601.825, 'src': 'heatmap', 'start': 566.669, 'weight': 5, 'content': [{'end': 575.457, 'text': "ok. so now what I'm going to do is and I know all this stuff is irrelevant.", 'start': 566.669, 'duration': 8.788}, {'end': 576.738, 'text': 'this was from my previous example.', 'start': 575.457, 'duration': 1.281}, {'end': 585.014, 'text': 'So if a blob is near x y, then first of all I want to do is blob, add x y.', 'start': 577.87, 'duration': 7.144}, {'end': 586.615, 'text': 'I want to add that point to the blob.', 'start': 585.014, 'duration': 1.601}, {'end': 589.517, 'text': 'And then I want to say found equals true.', 'start': 587.676, 'duration': 1.841}, {'end': 591.398, 'text': "And then I'm going to say break.", 'start': 590.378, 'duration': 1.02}, {'end': 599.824, 'text': "Now there's a little bit of a problem here where I probably should check all of the blobs and find the one that it's closest to.", 'start': 591.518, 'duration': 8.306}, {'end': 601.825, 'text': "But I'm not going to worry about that right now.", 'start': 600.204, 'duration': 1.621}], 'summary': 'Describing a process to add a point to a blob and mark it as found.', 'duration': 23.955, 'max_score': 566.669, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ce-2l2wRqO8/pics/ce-2l2wRqO8566669.jpg'}, {'end': 774.092, 'src': 'embed', 'start': 742.213, 'weight': 0, 'content': [{'end': 750.299, 'text': 'This is a processing function minimum that says if x is less than minimum x, whichever one of these is less, use that one.', 'start': 742.213, 'duration': 8.086}, {'end': 761.629, 'text': 'So I should be able to just do this and the same thing here like this.', 'start': 751.32, 'duration': 10.309}, {'end': 769.395, 'text': 'So I just want to get I could have written if statements like if x is less than minimum x, then the minimum x is now x, that sort of thing.', 'start': 762.269, 'duration': 7.126}, {'end': 770.636, 'text': 'but this should do that trick.', 'start': 769.395, 'duration': 1.241}, {'end': 774.092, 'text': 'This should add the blob.', 'start': 771.889, 'duration': 2.203}], 'summary': 'Processing function sets minimum value for x to ensure it is less than or equal to the current minimum.', 'duration': 31.879, 'max_score': 742.213, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ce-2l2wRqO8/pics/ce-2l2wRqO8742213.jpg'}, {'end': 878.602, 'src': 'heatmap', 'start': 797.494, 'weight': 1, 'content': [{'end': 803.579, 'text': 'By the way, in processing, the rectangle mode corners allows you to specify the top left and the bottom right of a rectangle.', 'start': 797.494, 'duration': 6.085}, {'end': 804.76, 'text': 'And those are the values I have.', 'start': 803.619, 'duration': 1.141}, {'end': 809.784, 'text': "So I'm going to say rect min x min y max x max y.", 'start': 805.12, 'duration': 4.664}, {'end': 813.212, 'text': 'So I added a whole, the blob does a couple things.', 'start': 810.748, 'duration': 2.464}, {'end': 816.436, 'text': 'It checks to see if a pixel is near it, and can say true or false.', 'start': 813.472, 'duration': 2.964}, {'end': 822.625, 'text': 'It also can add that pixel to expand or contract its rectangle, and then it can also draw that rectangle.', 'start': 816.797, 'duration': 5.828}, {'end': 827.422, 'text': 'And now in this particular algorithm, this is it.', 'start': 822.925, 'duration': 4.497}, {'end': 831.183, 'text': "I think I've got everything here if it's near.", 'start': 827.422, 'duration': 3.761}, {'end': 840.865, 'text': "if it's near, at that point I found it otherwise add a new blob and then at the end here, after I go through all the pixels,", 'start': 831.183, 'duration': 9.682}, {'end': 847.647, 'text': 'I should be able to go through all of the blobs and say blob dot show.', 'start': 840.865, 'duration': 6.782}, {'end': 854.328, 'text': "ok, I'm sure I missed something, but let's try running it.", 'start': 847.647, 'duration': 6.681}, {'end': 858.126, 'text': 'The variable px does not exist.', 'start': 856.325, 'duration': 1.801}, {'end': 861.469, 'text': 'Oh, right, because this is now x and y.', 'start': 859.367, 'duration': 2.102}, {'end': 866.493, 'text': 'Uh-oh, max x equals x.', 'start': 861.469, 'duration': 5.024}, {'end': 867.553, 'text': 'I have an error in the chat.', 'start': 866.493, 'duration': 1.06}, {'end': 869.435, 'text': "Someone's telling me there's an error in the constructor.", 'start': 867.573, 'duration': 1.862}, {'end': 870.796, 'text': 'Max, thank you.', 'start': 869.835, 'duration': 0.961}, {'end': 872.517, 'text': 'Okay, so this was a big error.', 'start': 870.996, 'duration': 1.521}, {'end': 874.238, 'text': 'That would have caused me a major problem.', 'start': 872.537, 'duration': 1.701}, {'end': 878.602, 'text': 'Okay, here we go.', 'start': 877.581, 'duration': 1.021}], 'summary': 'Processing algorithm detects and manipulates rectangles, identifies pixels, and resolves errors', 'duration': 81.108, 'max_score': 797.494, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ce-2l2wRqO8/pics/ce-2l2wRqO8797494.jpg'}, {'end': 915.691, 'src': 'heatmap', 'start': 885.19, 'weight': 0.764, 'content': [{'end': 887.47, 'text': "It's finding zillions of little tiny blobs.", 'start': 885.19, 'duration': 2.28}, {'end': 888.991, 'text': 'Ooh, look at all the little tiny blobs.', 'start': 887.59, 'duration': 1.401}, {'end': 889.951, 'text': 'Little tiny blobs.', 'start': 889.211, 'duration': 0.74}, {'end': 891.992, 'text': 'Look, find some more little tiny blobs.', 'start': 890.231, 'duration': 1.761}, {'end': 896.773, 'text': 'So I think my distance threshold needs to be a little bit bigger.', 'start': 892.532, 'duration': 4.241}, {'end': 900.159, 'text': '25 pixels.', 'start': 899.398, 'duration': 0.761}, {'end': 904.842, 'text': 'So that is something I need to make a variable.', 'start': 900.199, 'duration': 4.643}, {'end': 906.123, 'text': 'So I want to make this a variable.', 'start': 904.923, 'duration': 1.2}, {'end': 907.144, 'text': "Let's just do this right now.", 'start': 906.144, 'duration': 1}, {'end': 910.427, 'text': 'Oh, right, because this all the way was distance squared.', 'start': 908.525, 'duration': 1.902}, {'end': 911.848, 'text': "So it wasn't so crazy.", 'start': 910.627, 'duration': 1.221}, {'end': 915.691, 'text': "So I'm going to make a, so this is the color threshold.", 'start': 912.288, 'duration': 3.403}], 'summary': 'Adjusting distance threshold to 25 pixels for finding tiny blobs.', 'duration': 30.501, 'max_score': 885.19, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ce-2l2wRqO8/pics/ce-2l2wRqO8885190.jpg'}, {'end': 926.647, 'src': 'embed', 'start': 900.199, 'weight': 2, 'content': [{'end': 904.842, 'text': 'So that is something I need to make a variable.', 'start': 900.199, 'duration': 4.643}, {'end': 906.123, 'text': 'So I want to make this a variable.', 'start': 904.923, 'duration': 1.2}, {'end': 907.144, 'text': "Let's just do this right now.", 'start': 906.144, 'duration': 1}, {'end': 910.427, 'text': 'Oh, right, because this all the way was distance squared.', 'start': 908.525, 'duration': 1.902}, {'end': 911.848, 'text': "So it wasn't so crazy.", 'start': 910.627, 'duration': 1.221}, {'end': 915.691, 'text': "So I'm going to make a, so this is the color threshold.", 'start': 912.288, 'duration': 3.403}, {'end': 918.593, 'text': 'And I want to make a distance threshold.', 'start': 915.951, 'duration': 2.642}, {'end': 921.776, 'text': "And I'm going to say that's equal to 25, just having these be the same.", 'start': 919.054, 'duration': 2.722}, {'end': 926.647, 'text': 'And first of all, this needs to be distance threshold times distance threshold.', 'start': 923.445, 'duration': 3.202}], 'summary': 'Setting distance threshold variable to 25.', 'duration': 26.448, 'max_score': 900.199, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ce-2l2wRqO8/pics/ce-2l2wRqO8900199.jpg'}], 'start': 500.166, 'title': 'Pixel distance calculation and blob detection algorithm', 'summary': 'Discusses the process of calculating pixel distance and method overloading in java, as well as implementing a blob detection algorithm focusing on proximity logic, adding pixels to blobs, and implementation challenges.', 'chapters': [{'end': 551.562, 'start': 500.166, 'title': 'Pixel distance calculation', 'summary': 'Discusses the process of calculating pixel distance and the utilization of method overloading in java for different function arguments.', 'duration': 51.396, 'highlights': ['The chapter discusses the process of calculating pixel distance and the utilization of method overloading in Java for different function arguments.', 'The speaker explores the concept of using method overloading in Java, highlighting its functionality in differentiating between functions with the same name but different arguments.', 'The speaker considers the calculation of pixel distance, emphasizing the intention to determine if a pixel is within a certain distance.']}, {'end': 950.723, 'start': 551.562, 'title': 'Blob detection algorithm', 'summary': 'Describes the process of implementing a blob detection algorithm in a programming environment, focusing on the logic for checking proximity, adding pixels to blobs, and the challenges faced during the implementation.', 'duration': 399.161, 'highlights': ['Implemented logic to check proximity of a pixel to a blob and return true if within a certain distance, with a variable distance threshold of 25 pixels. Implemented logic for checking if a pixel is near a blob with a distance threshold of 25 pixels, aiming to make the threshold a variable for flexibility.', 'Discussed the process of adding a pixel to a blob and setting a flag to true, along with encountering a challenge of not checking all blobs to find the closest one. Discussed adding a pixel to a blob and setting a flag to true, while acknowledging the need to address the issue of finding the closest blob in the future.', 'Explored the need to change the representation of a blob by using the min-max coordinate system instead of x, y, width, and height to facilitate easier operations. Explored the decision to represent a blob using the min-max coordinate system for easier operations and manipulation.']}], 'duration': 450.557, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ce-2l2wRqO8/pics/ce-2l2wRqO8500166.jpg', 'highlights': ['The chapter discusses the process of calculating pixel distance and the utilization of method overloading in Java for different function arguments.', 'Implemented logic to check proximity of a pixel to a blob and return true if within a certain distance, with a variable distance threshold of 25 pixels.', 'The speaker explores the concept of using method overloading in Java, highlighting its functionality in differentiating between functions with the same name but different arguments.', 'Discussed the process of adding a pixel to a blob and setting a flag to true, along with encountering a challenge of not checking all blobs to find the closest one.', 'The speaker considers the calculation of pixel distance, emphasizing the intention to determine if a pixel is within a certain distance.', 'Explored the need to change the representation of a blob by using the min-max coordinate system instead of x, y, width, and height to facilitate easier operations.']}, {'end': 1265.886, 'segs': [{'end': 1046.241, 'src': 'embed', 'start': 1011.435, 'weight': 3, 'content': [{'end': 1025.287, 'text': 'but I could write one And I could just say return max x, minus min x times, max y, minus, min y, like the width and the height of the blob,', 'start': 1011.435, 'duration': 13.852}, {'end': 1025.808, 'text': 'so to speak.', 'start': 1025.287, 'duration': 0.521}, {'end': 1026.969, 'text': 'Multiply them together.', 'start': 1025.988, 'duration': 0.981}, {'end': 1029.851, 'text': 'And I could say, they have to be greater than 500.', 'start': 1026.989, 'duration': 2.862}, {'end': 1030.832, 'text': 'This would get rid of small blobs.', 'start': 1029.851, 'duration': 0.981}, {'end': 1046.241, 'text': 'Right, oh, and that threshold, yeah, yeah, I meant to, by the way, so, you know, this is also what I can change here.', 'start': 1038.435, 'duration': 7.806}], 'summary': 'Using max and min values of x and y to filter blobs greater than 500.', 'duration': 34.806, 'max_score': 1011.435, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ce-2l2wRqO8/pics/ce-2l2wRqO81011435.jpg'}, {'end': 1142.161, 'src': 'embed', 'start': 1107.084, 'weight': 1, 'content': [{'end': 1108.886, 'text': "There's, I think, a bunch of things I could improve here.", 'start': 1107.084, 'duration': 1.802}, {'end': 1113.709, 'text': 'One, I could make a nicer interface to kind of tweak these thresholds of color, the distance threshold.', 'start': 1108.946, 'duration': 4.763}, {'end': 1118.752, 'text': "You know, it might be nice to sort of draw the rectangle, the blob rectangle with some alpha so I could see what's behind it.", 'start': 1114.089, 'duration': 4.663}, {'end': 1120.333, 'text': 'You know.', 'start': 1119.992, 'duration': 0.341}, {'end': 1131.532, 'text': "one thing that's really kind of important about this to mention I'll mention this again is, come back to me code.", 'start': 1120.333, 'duration': 11.199}, {'end': 1142.161, 'text': "is that, whoops, it's funny, it worked much better without me clicking on it anyway is that there's no sense of and I should so, by the way, this,", 'start': 1131.532, 'duration': 10.629}], 'summary': 'Improvements needed in interface design and code functionality.', 'duration': 35.077, 'max_score': 1107.084, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ce-2l2wRqO8/pics/ce-2l2wRqO81107084.jpg'}, {'end': 1179.997, 'src': 'embed', 'start': 1150.147, 'weight': 0, 'content': [{'end': 1151.548, 'text': "I don't know what I'm doing here.", 'start': 1150.147, 'duration': 1.401}, {'end': 1158.106, 'text': "so one of the things that's really important is, let's say you wanted to have An image.", 'start': 1151.548, 'duration': 6.558}, {'end': 1160.287, 'text': 'follow this cup and an image.', 'start': 1158.106, 'duration': 2.181}, {'end': 1160.968, 'text': 'follow this cup.', 'start': 1160.287, 'duration': 0.681}, {'end': 1162.188, 'text': "Look, it's working beautifully right now.", 'start': 1160.988, 'duration': 1.2}, {'end': 1164.569, 'text': 'An image follow this cup and an image follow this cup.', 'start': 1162.428, 'duration': 2.141}, {'end': 1171.952, 'text': 'What if I wanted to put a cat over here and a dog over here?', 'start': 1164.589, 'duration': 7.363}, {'end': 1175.274, 'text': "This blob is going to be found first because of the way I'm iterating through the pixels.", 'start': 1171.992, 'duration': 3.282}, {'end': 1177.995, 'text': 'So this blob is always going to be blob 0.', 'start': 1175.514, 'duration': 2.481}, {'end': 1179.997, 'text': 'But now this blob is going to be blob 0.', 'start': 1177.995, 'duration': 2.002}], 'summary': 'Discussion on image processing and blob detection.', 'duration': 29.85, 'max_score': 1150.147, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ce-2l2wRqO8/pics/ce-2l2wRqO81150147.jpg'}, {'end': 1221.329, 'src': 'embed', 'start': 1190.989, 'weight': 2, 'content': [{'end': 1192.171, 'text': "So I'm going to show you how to do that.", 'start': 1190.989, 'duration': 1.182}, {'end': 1193.292, 'text': 'Boy, this is working so nicely.', 'start': 1192.231, 'duration': 1.061}, {'end': 1193.893, 'text': "I'm so pleased.", 'start': 1193.332, 'duration': 0.561}, {'end': 1201.09, 'text': 'Look, I can put Mickey Mouse ears on myself.', 'start': 1198.907, 'duration': 2.183}, {'end': 1203.172, 'text': "Anyway, I'm going to go do this on my own time.", 'start': 1201.55, 'duration': 1.622}, {'end': 1205.636, 'text': "You don't need to watch me do the weird stuff with the blob.", 'start': 1203.233, 'duration': 2.403}, {'end': 1209.221, 'text': "But I'm going to do that in a future video.", 'start': 1205.896, 'duration': 3.325}, {'end': 1210.242, 'text': 'Let me say one last thing.', 'start': 1209.241, 'duration': 1.001}, {'end': 1217.007, 'text': "So ultimately, If you want to do this, and I'm going to show this in another video, there are ample sets of processing libraries.", 'start': 1210.442, 'duration': 6.565}, {'end': 1218.668, 'text': "There's blob detection.", 'start': 1217.227, 'duration': 1.441}, {'end': 1219.568, 'text': "There's OpenCV.", 'start': 1218.708, 'duration': 0.86}, {'end': 1221.329, 'text': "There's a lot of processing libraries that will do this.", 'start': 1219.588, 'duration': 1.741}], 'summary': 'Demonstrating use of processing libraries for blob detection and opencv in future videos.', 'duration': 30.34, 'max_score': 1190.989, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ce-2l2wRqO8/pics/ce-2l2wRqO81190989.jpg'}], 'start': 952.089, 'title': 'Blob detection', 'summary': 'Introduces real-time modification of blob detection algorithm and demonstrates the process of blob detection in image processing, emphasizing challenges and recommendations for improvement.', 'chapters': [{'end': 1150.147, 'start': 952.089, 'title': 'Real-time blob modification', 'summary': 'Introduces real-time modification of blob detection algorithm to filter blobs based on size and color threshold, with a potential for further improvement in interface and threshold values.', 'duration': 198.058, 'highlights': ['The algorithm can filter blobs based on size and color threshold The speaker demonstrates the ability to filter out blobs based on a certain size by setting a threshold, for example, only showing blobs with a size greater than 100.', 'Potential for improvement in interface and threshold values The speaker suggests potential improvements such as creating a nicer interface to tweak color and distance thresholds, and adding the ability to draw the blob rectangle with some alpha for better visualization.', 'Initial threshold values for size and color are mentioned The speaker mentions that the initial threshold for the distance should be around 75, and suggests starting with a size threshold greater than 100 and adjusting it as needed.']}, {'end': 1265.886, 'start': 1150.147, 'title': 'Blob detection in image processing', 'summary': 'Demonstrates the process of blob detection in image processing, emphasizing the challenges of tracking blobs over time and the recommendation of utilizing processing libraries such as opencv and considering contours for more advanced detection.', 'duration': 115.739, 'highlights': ['Iterating through pixels allows for the identification and tracking of blobs, with the demonstration of challenges in assigning ID numbers to blobs, as well as the potential addition of tracking capabilities, which could enhance the process significantly.', 'The recommendation to utilize processing libraries such as OpenCV and consider contours for more advanced blob detection provides valuable insights for enhancing the detection process and streamlining the code development, offering a more efficient approach to achieving the desired results.', 'The mention of the need for brightness thresholding or color-specific detection in the image prior to passing it to the blob detection library highlights the considerations for pre-processing steps, indicating the importance of optimizing the input image for effective blob detection.']}], 'duration': 313.797, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/ce-2l2wRqO8/pics/ce-2l2wRqO8952089.jpg', 'highlights': ['The recommendation to utilize processing libraries such as OpenCV and consider contours for more advanced blob detection provides valuable insights for enhancing the detection process and streamlining the code development, offering a more efficient approach to achieving the desired results.', 'Iterating through pixels allows for the identification and tracking of blobs, with the demonstration of challenges in assigning ID numbers to blobs, as well as the potential addition of tracking capabilities, which could enhance the process significantly.', 'The algorithm can filter blobs based on size and color threshold The speaker demonstrates the ability to filter out blobs based on a certain size by setting a threshold, for example, only showing blobs with a size greater than 100.', 'Potential for improvement in interface and threshold values The speaker suggests potential improvements such as creating a nicer interface to tweak color and distance thresholds, and adding the ability to draw the blob rectangle with some alpha for better visualization.', 'The mention of the need for brightness thresholding or color-specific detection in the image prior to passing it to the blob detection library highlights the considerations for pre-processing steps, indicating the importance of optimizing the input image for effective blob detection.', 'Initial threshold values for size and color are mentioned The speaker mentions that the initial threshold for the distance should be around 75, and suggests starting with a size threshold greater than 100 and adjusting it as needed.']}], 'highlights': ['The recommendation to utilize processing libraries such as OpenCV and consider contours for more advanced blob detection provides valuable insights for enhancing the detection process and streamlining the code development, offering a more efficient approach to achieving the desired results.', 'The algorithm can filter blobs based on size and color threshold The speaker demonstrates the ability to filter out blobs based on a certain size by setting a threshold, for example, only showing blobs with a size greater than 100.', "The process involves iterating through pixels, checking for their color, and determining their proximity to existing blobs. The algorithm involves iteratively checking pixels for their color, and if they are near an existing blob, they are added to it, potentially expanding the blob's dimensions.", 'The algorithm aims to detect individual blobs by analyzing the average location of specific colored pixels, addressing the limitation of tracking multiple objects as a single entity.', 'The tutorial involves breaking down the process of identifying pixels of a certain color, such as red, to determine the presence of individual blobs, highlighting the iterative nature of the algorithm.', 'The speaker humorously illustrates the application of the algorithm using taped plastic cups on a green wall, emphasizing the practical implementation of the programming tutorial.', 'The goal of implementing a Java class for each blob is emphasized. The blobs are represented by Java classes, each containing properties such as x, y, width, and height, essentially forming rectangles to encapsulate the clusters of red pixels.', 'Creation of Blob Objects using Array Lists The algorithm involves creating an array list of blob objects, enabling the flexibility to start with none and add more as needed.', 'Identification of Blob Proximity The process entails determining the distance between a specific xy point and a blob, with the objective of identifying if the point is near the center of the blob.', 'Calculation of Blob Center The algorithm demonstrates the calculation of the center of a blob by utilizing the x and y coordinates along with the width and height parameters.', 'The chapter discusses the process of calculating pixel distance and the utilization of method overloading in Java for different function arguments.', 'Implemented logic to check proximity of a pixel to a blob and return true if within a certain distance, with a variable distance threshold of 25 pixels.', 'The speaker explores the concept of using method overloading in Java, highlighting its functionality in differentiating between functions with the same name but different arguments.', 'Discussed the process of adding a pixel to a blob and setting a flag to true, along with encountering a challenge of not checking all blobs to find the closest one.', 'The speaker considers the calculation of pixel distance, emphasizing the intention to determine if a pixel is within a certain distance.', 'Explored the need to change the representation of a blob by using the min-max coordinate system instead of x, y, width, and height to facilitate easier operations.', 'Potential for improvement in interface and threshold values The speaker suggests potential improvements such as creating a nicer interface to tweak color and distance thresholds, and adding the ability to draw the blob rectangle with some alpha for better visualization.', 'The mention of the need for brightness thresholding or color-specific detection in the image prior to passing it to the blob detection library highlights the considerations for pre-processing steps, indicating the importance of optimizing the input image for effective blob detection.', 'Initial threshold values for size and color are mentioned The speaker mentions that the initial threshold for the distance should be around 75, and suggests starting with a size threshold greater than 100 and adjusting it as needed.']}