简体   繁体   中英

Opencv Multiplication of Large matrices

I have 2 matrices of dimension 1*280000.

I wanted to multiply one matrix with transposed second matrix using opencv.

I tried to multiply them using Multiplication operator(*).

But it is giving me error :'The total size matrix does not fit to size_t type'

As after multiplication the size will be 280000*28000 of matrix.

So,I am thinking multiplication should 32 bit.

Is there any method to do the 32bit multiplication?

Why do you want to multiply them like that? But because this is an answer, I would like to help you thinking more than just do it:

  • supposing that you have the two matrix: A and B ( A.size() == B.size() == [1x280000] ).
  • and A * Bt() = AB (AB is the result)
  • then AB = [A[0][0]*BA[0][1]*B ... A[0][279999]*B] (each column is the transposed matrix multiplied by the corresponding element of the other matrix)

AB may also be written as:

 [ B[0][0]*A B[0][1]*A ... B[0][279999]*A] 

(each row of the result will be the row matrix multiplied by the corresponding element of the column (transposed) matrix)

Hope that this will help you in what you are doing... Using a for loop you can print, or store, or what you need with the result

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM