I need to find the position of sun from the center of the image in matlab.
Also how to draw vertical and horizontal lines from the center point in matlab
If this is a 2-D image and the center of the image is assigned the coordinates (0,0) then the position p, is given by (x,y) where x and y are the distances along a pair of orthogonal axes. The distance of the point p(x,y) from the origin at (0,0) is:
\( p(x,y)\;=\;\sqrt{x^2\;+\;y^2} \)
Drawing horizontal and vertical lines can be done in several different ways:
How would you define the center of the image? I would define it in terms of the number of pixels in each dimension. There may or may not be a pixel in the center of the image. In order for that to be the case the number of pixels in each direction would need to be odd and AFAIK that never happens in image processing.