How to multiply the following?
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Considering an image I of any size. A mask of size 1X10. How to multiply those two?
3 Commenti
Jan
il 10 Set 2012
You cannot multiply a [MxNx3] array directly by a [1x10] vector. It is not clear what kind of output you expect for such a calculation.
Risposta accettata
Titus Edelhofer
il 10 Set 2012
Hi,
the error indicates what's wrong: your image and your mask have different types (probably your image is e.g. uint8 and your mask is double). If you need your mask to have non integer values (e.g. 2.345), convert your image to double:
dblImage = double(yourImage);
Otherwise you might try to convert your mask to the same integer type as your image (by using uint8, ...).
Titus
4 Commenti
Titus Edelhofer
il 10 Set 2012
Hi,
if you do it by loop, you need to index deg0 as well:
filtImage0(i,j) = threshImage(i,j).*deg0(i);
or
filtImage0(i,j) = threshImage(i,j).*deg0(j);
Titus
Più risposte (0)
Vedere anche
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!