数据类型问题,累加到255就不增长了。
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
nosokel
il 4 Apr 2023
Risposto: ditehen jewhan
il 4 Apr 2023
我用断点看了,这个gray变量增加到255就不变了,这是为什么呢?应该是数据类型的原因感觉matlab好多莫名其妙的问题!!!!!一点不友好:'(
0 Commenti
Risposta accettata
ditehen jewhan
il 4 Apr 2023
gray的数据类型直接由加数的类型决定,因为im2gray结果的数据类型是uint8,所以A(i,j)以及gray都是uint8类型。建议加一步转换数据类型的步骤,x=int16(A(i,j));gray=gray+x;
0 Commenti
Più risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!