Prev: Regarding the continuous process of getting an image from webcam and then processing it by identifying the two points in an image, and then finding the distance between the two black points!
Next: visualization of a 3D matrix
From: Benson on 17 Jun 2010 00:50 for r= 0:radius for rad = 0: (pi/180): (2*pi) %the coordiante from whole image x=xcentre+(r*cos(rad)); y=ycentre+(r*sin(rad)); %the coordiante from centre of the circle px = x-xcentre; py = y-ycentre; %distance of px and py dx = abs(x-xcentre); dy = abs(y-ycentre); p = abs(sqrt((dx^2)+(dy^2))); gamma = (pi/2)-asin(dx/r)-atan(py/px); px1 = (p*cos(asin(dx/r)+atan(py/px)-(dx/r))); py1 = (p*sin(asin(dx/r)+atan(py/px)-(dx/r))); x1 = int16(xcentre + px1); y1 = int16(ycentre + py1); end; end; above are the result . I want to save px px1 py py1 result each time into txt file something like test.txt px px1 py py1 0 1 0 1.2 ....... .....so on don't quite get it how to use display to achieve the result i want it. Thanks everyone that help me.
From: Benson on 17 Jun 2010 00:59
"Benson " <popo2424(a)gmail.com> wrote in message <hvc9ic$4a4$1(a)fred.mathworks.com>... > for r= 0:radius > for rad = 0: (pi/180): (2*pi) > %the coordiante from whole image > x=xcentre+(r*cos(rad)); > y=ycentre+(r*sin(rad)); > %the coordiante from centre of the circle > px = x-xcentre; > py = y-ycentre; > %distance of px and py > dx = abs(x-xcentre); > dy = abs(y-ycentre); > p = abs(sqrt((dx^2)+(dy^2))); > > gamma = (pi/2)-asin(dx/r)-atan(py/px); > px1 = (p*cos(asin(dx/r)+atan(py/px)-(dx/r))); > py1 = (p*sin(asin(dx/r)+atan(py/px)-(dx/r))); > x1 = int16(xcentre + px1); > y1 = int16(ycentre + py1); > > > end; > end; > > above are the result . > I want to save px px1 py py1 result each time into txt file > > something like test.txt > px px1 py py1 > 0 1 0 1.2 > ...... > ....so on > > don't quite get it how to use display to achieve the result i want it. > Thanks everyone that help me. like px px1 py py1 0 1 0 1 1 2 0 2 |