Hough transform basics

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello guys in today's video we are going to discuss about the half transform so Hough transform is used for edge linking what is edge linking let us see consider this is an image image of a box so this is the different colors that the box have so what we need to do is we need to detect the edges of this box so the edges of the box means I just want these edges this cuboid structure over here so in order to do that we have to use an edge detecting mask so we have this Sobel mask with us we can use this oval mask we can utility ribbits math so we have different masks and when we apply the different masks we get the edges of the image but what happens is due to some noise in the image or do you do some you know some changes in the image what we get as an output of an edge detector is something like this so you know your you can see some breaks in the edge detection you can see that the edge detection is not perfect you are not getting a perfect cube as you wanted so this is a problem that is faced by the different edge detecting masks that we have so in order to fill these edges the technique of edge linking is used so what is edge linking is basically you are connecting these points so basically what you have to do is you need to connect these line over here this line over here this line over here this line out but now this is not something that has to be done by a human this is something that the machine should do itself so hence the algorithms by which the machine can link these edges are known as edge linking algorithms so one of those algorithm is the half transform which we are going to discuss today so now let us see how can we proceed further with the algorithm so consider now suppose this is a made okay so you're these are the different pixel values so I can put this pixel value on an XY plane where the X and numbers will denote the pixels in the columns that is zero pixel 1 2 3 and the y pixel of the rows so if suppose I am talking about this pixel so that will give me 2 comma 3 comma 2 so this is 3 comma sorry 2 comma 2 so this is 2 comma 2 pixel so like this I can basically plot a image on an XY plane so that is what I have done over here and this x1 y1 and x2 y2 are the two points that are detected by the edge detection algorithm so suppose this is a point and this is a point that has been detected by the edge detection algorithm that is the edge detection mask so here you can see that there is an break over here so this is just for a explanation purpose this is a very small image if you see this is just a three by three major images are 1 0 to 4 cross 1 0 to 4 pixels so we have a huge pixel so consider that this is a huge image and there is x1 y1 and x2 y2 they are the two points that are detected by the edge and what we need to do is we need to join this we need to join this or link this edge so here you can see that for a human this is very easy you just have to cross a line over here and you can join the edge but the same is not true for a machine because if you want to join this line in if you want the machine to join this line then what will you have to do is you'll have to use the form the to point form Y minus y1 my upon y1 minus y2 equals X minus x1 upon x1 minus x2 so you will have to do this and then you will get a equation that is y is equal to MX plus C so this equation this will basically give you the line that you want so you will have to plot the line over that is y is equal to MX plus C so you can see doing this is a little tedious for a machine so this this basically increases the complexity of the algorithm so instead what we do over here is you know that the basic line equation is y is equal to MX plus C so what we can do is we can rewrite this equation as y is equal to say ax plus B so I have just replaced M by a and C by B next what I can do is I can write this equation as B is equal to minus ax plus y I have just put this ax over here so I can write B is equal to minus ax plus 5 so what I have done over here is basically I have converted my XY plane into a plane that is say a B plane so here you can see where in the initial equation I had X now I have a and where I had y there I have B so basically I am what I am going to do is I am going to map all the points on the XY plane to the a B plane why I am doing this I will tell you in a bit so basically let's see what happens so here when you put a point that is x1 comma y1 say this point is 1 comma 5 so when I put this so this point in the XY plane that becomes a line in the a B plane because what happens in a B plane is when this is the point that is 1 comma Phi so what I will do is I will put one over here D value of x1 and I will put Phi over here so I get minus a that is minus 1 a plus I will get 5 so here you can see B is equal to minus a plus Phi this is an equation in the a B plane because you can see this is of the type y is equal to MX plus C where the variables are not x and y but the variables are a and B so a point in the XY plane becomes a line in the a B plane next what I can do is similarly I will plot this point x2 comma y2 so suppose this point is some let you you can take any point say lettuce for simplicity take it in the origin so that is 0 comma 0 so when I put 0 comma 0 what I get is B is equal to this is 0 this is 0 so I get B is equal to 0 so B is equal to 0 is nothing but this B is equal to 0 is the a this this line this is my B is equal to 0 so what you see is next is here you can see an intersection so this point whatever this point is this will be say some a1 comma B even this point will be transformed into a line in the XY plane so here actually if I have used this two points 0 and 1 comma Phi this this will be this line so basically what I have done is I have converted this point into a line and this point into a line next I have found the intersection of the two lines so this point that I get by the intersection of the two lines is then Reap lotted on the XY plane as a line because you know every point over here becomes a line over here and every point over here becomes over here so that is the mapping in the a/b plane so this for a machine is very easier to do so when you convert this XY plane into a a B plane and then you find a line this becomes very easy hence this is what we do in the half transform
Info
Channel: Pratik Jain
Views: 34,538
Rating: undefined out of 5
Keywords: Hough Transform, image processing, edge linking
Id: 5gik4qtNoNo
Channel Id: undefined
Length: 9min 1sec (541 seconds)
Published: Sun Sep 23 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.