verne.freenode.net changed the topic of #mlpack to: http://www.mlpack.org/ -- We don't respond instantly... but we will respond. Give it a few minutes. Or hours. -- Channel logs: http://www.mlpack.org/irc/
tsathoggua has joined #mlpack
Mathnerd314 has quit [Ping timeout: 244 seconds]
tsathoggua has quit [Quit: Konversation terminated!]
nilay has joined #mlpack
nilay has quit [Ping timeout: 250 seconds]
Mathnerd314 has joined #mlpack
nilay has joined #mlpack
< nilay>
zoq: i am having problem in understanding numpy.dot
< nilay>
this is because numpy and arma seem to store arrays as different
< nilay>
a (4,4,3) array in numpy is four, (4 * 3) matrices
< nilay>
and in arma it is three, (4 * 4) matrices
< nilay>
so the code i have written for this line: xyz = N.dot(src, rgb2xyz_mat) , in the RGB2LUV function is being incorrect
< nilay>
and i am unable to fix it, having spent quite a lot of time on this.
Mathnerd314 has quit [Ping timeout: 252 seconds]
< zoq>
numpy is row major and armadillo is column major, so everytime numpy iterates over the rows you iterate over the columns
< zoq>
another solution is to transpose the matrix, so you could do src.t() or arma::trans(src).
< zoq>
Does, this solve the problem?
< nilay>
src is a 3d matrix
< nilay>
a cube
< zoq>
and I guess rgb2xyz_mat is a 2d martix?
< nilay>
yes
< zoq>
and the output of xyz is a 2d matrix?
< nilay>
3d matrix
< zoq>
okay, so what you do is to iterate over the slices of src: xyz.slice(i) = src.slice(i) * rgb2xyz_mat?
< nilay>
no
< nilay>
src.slice(i) is of dimension (img.rows, img.cols)
< nilay>
rgb2xyz_mat is of dimension (3, 3)
< zoq>
and img.rows is the actual image size?
< nilay>
yes
< zoq>
hm, sounds weird, I need to take a look
< nilay>
documentation of numpy.dot says: For N dimensions it is a sum product over the last axis of a and the second-to-last of b. so i tried writing this using loops, but then also i can't get correct answer
< nilay>
if we are doing numpy.dot(a, b)
< zoq>
okay, so what this does is to transform the rgb values into the CIE 1931 XYZ values.
< zoq>
So, you multiply the rgb values with the transformation matrix. Right now I can only think of a naive implementation.