Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
access matrix

Subject: access matrix

From: amira ali

Date: 4 Feb, 2013 14:47:08

Message: 1 of 9

need help urgently

i have location of interest points in matrix A(2*13 ) where 2 is x,y of point and 13 is total number of points for example:
x y
72.6781959551728 46.7543453323974
71.9155271184922 100.930596158669

and i have another matrix called flow (120*160) this matrix contain velocity of every pixel (v in x direction) and (v in y direction). all i need it how can i get the velocity of 13 interest points from this matrix flow so finally i must have
x y v(x) v(y)
72. 46.7543 0.087396 -0.135287

Subject: access matrix

From: Jos (10584)

Date: 5 Feb, 2013 09:09:10

Message: 2 of 9

"amira ali" wrote in message <keohlb$51a$1@newscl01ah.mathworks.com>...
> need help urgently
>
> i have location of interest points in matrix A(2*13 ) where 2 is x,y of point and 13 is total number of points for example:
> x y
> 72.6781959551728 46.7543453323974
> 71.9155271184922 100.930596158669
>
> and i have another matrix called flow (120*160) this matrix contain velocity of every pixel (v in x direction) and (v in y direction). all i need it how can i get the velocity of 13 interest points from this matrix flow so finally i must have
> x y v(x) v(y)
> 72. 46.7543 0.087396 -0.135287

Using x and y as indexes in a matrix requires them to be integers ...

Your question is also not very clear. You have "another matrix called flow" which is 2D but you index a one-dimensional vector v, using v(x) and v(y).

Please rephrase ...

~ Jos

Subject: access matrix

From: amira ali

Date: 5 Feb, 2013 17:13:15

Message: 3 of 9

"Jos (10584)" wrote in message <keqi7l$934$1@newscl01ah.mathworks.com>...
> "amira ali" wrote in message <keohlb$51a$1@newscl01ah.mathworks.com>...
> > need help urgently
> >
> > i have location of interest points in matrix A(2*13 ) where 2 is x,y of point and 13 is total number of points for example:
> > x y
> > 72.6781959551728 46.7543453323974
> > 71.9155271184922 100.930596158669
> >
> > and i have another matrix called flow (120*160) this matrix contain velocity of every pixel (v in x direction) and (v in y direction). all i need it how can i get the velocity of 13 interest points from this matrix flow so finally i must have
> > x y v(x) v(y)
> > 72. 46.7543 0.087396 -0.135287
>
> Using x and y as indexes in a matrix requires them to be integers ...
>
> Your question is also not very clear. You have "another matrix called flow" which is 2D but you index a one-dimensional vector v, using v(x) and v(y).
>
> Please rephrase ...
>
> ~ Jos

it's not one dimensional vector it will be 13 rows and 4 coulmns , i written one row as example (location of points and their velocities)

Subject: access matrix

From: Jos (10584)

Date: 5 Feb, 2013 20:40:26

Message: 4 of 9

"amira ali" wrote in message <kerejb$qqn$1@newscl01ah.mathworks.com>...
> "Jos (10584)" wrote in message <keqi7l$934$1@newscl01ah.mathworks.com>...
> > "amira ali" wrote in message <keohlb$51a$1@newscl01ah.mathworks.com>...
> > > need help urgently
> > >
> > > i have location of interest points in matrix A(2*13 ) where 2 is x,y of point and 13 is total number of points for example:
> > > x y
> > > 72.6781959551728 46.7543453323974
> > > 71.9155271184922 100.930596158669
> > >
> > > and i have another matrix called flow (120*160) this matrix contain velocity of every pixel (v in x direction) and (v in y direction). all i need it how can i get the velocity of 13 interest points from this matrix flow so finally i must have
> > > x y v(x) v(y)
> > > 72. 46.7543 0.087396 -0.135287
> >
> > Using x and y as indexes in a matrix requires them to be integers ...
> >
> > Your question is also not very clear. You have "another matrix called flow" which is 2D but you index a one-dimensional vector v, using v(x) and v(y).
> >
> > Please rephrase ...
> >
> > ~ Jos
>
> it's not one dimensional vector it will be 13 rows and 4 coulmns , i written one row as example (location of points and their velocities)


in matlab v(x) means "the value of v at position (=index) x".

Perhaps you can give a very brief example of what you want to achieve with two points (= two x and y values) and a flow matrix which is, let's say, 3 by 4? It would be very helpful if you show the exact inputs and desired outputs.

Subject: access matrix

From: amira ali

Date: 5 Feb, 2013 21:19:14

Message: 5 of 9

"Jos (10584)" wrote in message <kerqnq$hg3$1@newscl01ah.mathworks.com>...
> "amira ali" wrote in message <kerejb$qqn$1@newscl01ah.mathworks.com>...
> > "Jos (10584)" wrote in message <keqi7l$934$1@newscl01ah.mathworks.com>...
> > > "amira ali" wrote in message <keohlb$51a$1@newscl01ah.mathworks.com>...
> > > > need help urgently
> > > >
> > > > i have location of interest points in matrix A(2*13 ) where 2 is x,y of point and 13 is total number of points for example:
> > > > x y
> > > > 72.6781959551728 46.7543453323974
> > > > 71.9155271184922 100.930596158669
> > > >
> > > > and i have another matrix called flow (120*160) this matrix contain velocity of every pixel (v in x direction) and (v in y direction). all i need it how can i get the velocity of 13 interest points from this matrix flow so finally i must have
> > > > x y v(x) v(y)
> > > > 72. 46.7543 0.087396 -0.135287
> > >
> > > Using x and y as indexes in a matrix requires them to be integers ...
> > >
> > > Your question is also not very clear. You have "another matrix called flow" which is 2D but you index a one-dimensional vector v, using v(x) and v(y).
> > >
> > > Please rephrase ...
> > >
> > > ~ Jos
> >
> > it's not one dimensional vector it will be 13 rows and 4 coulmns , i written one row as example (location of points and their velocities)
>
>
> in matlab v(x) means "the value of v at position (=index) x".
>
> Perhaps you can give a very brief example of what you want to achieve with two points (= two x and y values) and a flow matrix which is, let's say, 3 by 4? It would be very helpful if you show the exact inputs and desired outputs.
1-i have img1 (120*160*3) and img2 (120*160*3) then i get optical flow between two images in matrix called flow (120*160*2) (matrix flow contain velocity of every pixel in x direction and y direction).

2- i apply sift detector the image represent flow form img1 to img2 (mean flow image)
and i get location of set of interest points 13*2(13 point s and 2 is cordinates of point)

3- i want to get velocity of this points from matrix flow

simply that clear the meaning of optical flow which i read it

pixel at the coordinates p = (x; y) in an image I. If the pixel moves by u; v pixels between time t - 1 and time t, the brightness constancy assumption can be formulated as:
I(p; t - 1) = I(x + u; y + v; t)

Subject: access matrix

From: Bruno Luong

Date: 5 Feb, 2013 21:26:16

Message: 6 of 9

If I understand your problem, the function you need is INTERP2

Bruno

Subject: access matrix

From: amira ali

Date: 5 Feb, 2013 21:34:16

Message: 7 of 9

"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <kertdo$slm$1@newscl01ah.mathworks.com>...
> If I understand your problem, the function you need is INTERP2
>
> Bruno
what does it mean???????????

Subject: access matrix

From: amira ali

Date: 6 Feb, 2013 12:44:08

Message: 8 of 9

"amira ali" wrote in message <kertso$143$1@newscl01ah.mathworks.com>...
> "Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <kertdo$slm$1@newscl01ah.mathworks.com>...
> > If I understand your problem, the function you need is INTERP2
> >
> > Bruno
> what
any help plzzzzzzzzzzzzzzzz?????????????

Subject: access matrix

From: Jos (10584)

Date: 6 Feb, 2013 13:36:08

Message: 9 of 9

"amira ali" wrote in message <kert0i$qr8$1@newscl01ah.mathworks.com>...
> "Jos (10584)" wrote in message <kerqnq$hg3$1@newscl01ah.mathworks.com>...
> > "amira ali" wrote in message <kerejb$qqn$1@newscl01ah.mathworks.com>...
> > > "Jos (10584)" wrote in message <keqi7l$934$1@newscl01ah.mathworks.com>...
> > > > "amira ali" wrote in message <keohlb$51a$1@newscl01ah.mathworks.com>...
> > > > > need help urgently
> > > > >
> > > > > i have location of interest points in matrix A(2*13 ) where 2 is x,y of point and 13 is total number of points for example:
> > > > > x y
> > > > > 72.6781959551728 46.7543453323974
> > > > > 71.9155271184922 100.930596158669
> > > > >
> > > > > and i have another matrix called flow (120*160) this matrix contain velocity of every pixel (v in x direction) and (v in y direction). all i need it how can i get the velocity of 13 interest points from this matrix flow so finally i must have
> > > > > x y v(x) v(y)
> > > > > 72. 46.7543 0.087396 -0.135287
> > > >
> > > > Using x and y as indexes in a matrix requires them to be integers ...
> > > >
> > > > Your question is also not very clear. You have "another matrix called flow" which is 2D but you index a one-dimensional vector v, using v(x) and v(y).
> > > >
> > > > Please rephrase ...
> > > >
> > > > ~ Jos
> > >
> > > it's not one dimensional vector it will be 13 rows and 4 coulmns , i written one row as example (location of points and their velocities)
> >
> >
> > in matlab v(x) means "the value of v at position (=index) x".
> >
> > Perhaps you can give a very brief example of what you want to achieve with two points (= two x and y values) and a flow matrix which is, let's say, 3 by 4? It would be very helpful if you show the exact inputs and desired outputs.
> 1-i have img1 (120*160*3) and img2 (120*160*3) then i get optical flow between two images in matrix called flow (120*160*2) (matrix flow contain velocity of every pixel in x direction and y direction).
>
> 2- i apply sift detector the image represent flow form img1 to img2 (mean flow image)
> and i get location of set of interest points 13*2(13 point s and 2 is cordinates of point)
>
> 3- i want to get velocity of this points from matrix flow
>
> simply that clear the meaning of optical flow which i read it
>
> pixel at the coordinates p = (x; y) in an image I. If the pixel moves by u; v pixels between time t - 1 and time t, the brightness constancy assumption can be formulated as:
> I(p; t - 1) = I(x + u; y + v; t)

Dear Amira,

I think I'm beginning to understand your question, and my answer would be the same as Bruno's

In order to help you further I strongly suggest you do provide:
 "a very brief example of what you want to achieve with two points (= two x and y values) and a flow matrix which is, let's say, 3 by 4? It would be very helpful if you show the exact inputs and desired outputs."
as mentioned before.

And, please refrain from using multiple question marks etc, if you want to be taken seriously.

~ Jos

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us