Skip to main content

Posts

Showing posts from June, 2022

Hough Lines

consider the image like this we need to find the lines on this image  the basic lines would be horizontal ,vertical and inclined line  we will try to use hough to detect using equations  ok before that we need to understand the image co ordinate  top left is 0,0 assume it is the third quadrant , for  better understanding i have drawn a to show how a pixel is calculated from top left pixel arrangement for image    this is level zoom of more than 1000 , in real world u cannot see the pixel (1pixel of size 1,1)  alright now we can need to see how to find the lines on the first image the triangle on a zoomed in pixel wil look like this  ok we will start with the horizontal line calculation  since the pixel calculation is in the quadrant  i will shift or plot the values in  the first quadrant for my calculation  when shifted will look like this , for horizontal line calculation the theta of r must be at 90 degrees to the horizontal line u can see the value in diagram r = x cos𝛳 + y sin 𝛳

Hough Transform - Introduction

 So what is hough lines or the transform ,  Hough Line Transform is a transform used to detect straight lines. consider a image where u need to find the lines straight lines ,could be horizontal , vertical , diagonal lines in the image u can do that via the hough transform   before that there is something called   Cartesian coordinate system: Parameters: ( m , b ) . Polar coordinate system: Parameters: ( r , θ ) ( r , θ )   if the line equation is y = m * x +b  in the cartesian  x, y  in the polar it is  x = r cos(𝛳) y = r sin(𝛳) . we will see about this in detail  from the diagram u can see the inclined line and 𝛳 are related as x = r cos(𝛳) , the adjacent side of 𝛳 y = r sin(𝛳), the opposite side of 𝛳  ' r ' the distance from the origin the reference point to the line which hits the line at 90 degrees  ok so by Pythagoras  r = sqrt ( x ^2 + y^2) substitute for x and y  r = sqrt  (r^2 *x^2 cos^2 𝛳 + r^2 * y^2sin^2𝛳) cos^2 𝛳 + ^sin^2𝛳 = 1 r = r   ok what we have p

Learning rate

 So what is learning  rate and why it was introduced , sometimes it is called as step function ,why it is called the step function  it increases the step taken to reach from point a to b. alright u might be confused , let s go for an example    y = m* x  line equation x1 = x0 + 𝛿X  m1 = m0 +𝛿m  ok so what are these functions  will see one at a time  if y  = m * x and y = 3 and x =2 the value of m would be  m = y /x = 3 /2 =1.5 which is the slope of the equation . these might a real time example think of x as input and y as output  x can be a gold purchased year y can be gold rate  the gold rate increases as the year increases  the examples are just numbers don't think too much for now  in this case i know x and y i am going to keep the 'm 'as  the parameter  to be found by iteration or techniques in machine learning ,ok let go    we will take this example  m1 = m0 +𝛿m   y = m * x  , x =2 , y = 3  the idea here is to find the optimized value or the value closer to  m = y