古詩詞大全網 - 古詩大全 - opencv中這句話uchar* ptr = (uchar*)(pFrImg->imageData + x * pFrImg->widthStep);是什麽意思?

opencv中這句話uchar* ptr = (uchar*)(pFrImg->imageData + x * pFrImg->widthStep);是什麽意思?

pFrImg->imageData應該是指向壹片數據區的地址,

+ x*pFrImg->widthStep,就是從地址向後移動 x * pFrImg->widthStep 個單元,每個單元的大小要看imageData的指針類型

最後把移動後的地址強制轉換成uchar*