フィルターのクリア

Using double precision with vision.For​egroundDet​ector

1 回表示 (過去 30 日間)
Nathan Yonkee
Nathan Yonkee 2021 年 8 月 12 日
編集済み: Nathan Yonkee 2021 年 8 月 16 日
I am performing foreground detection on a 16 bit grayscale image. The vision.ForegroundDetector object only accepts images of uint8, double, or single data types. I tried using double precision as follows, but my output is 0 for every pixel:
detector = vision.ForegroundDetector(...
'MinimumBackgroundRatio', 0.55, ...
'NumTrainingFrames', 6, ...
'LearningRate', 0.005, ...
'InitialVariance', 24.^2);
fgMask = detector(im2double(frameGray));
However, if I use im2uint8 instead of im2double I get the detections I expect. I want to have full precision, so using im2uint8 doesn't solve my problem.
Edit: It is not just my images that this fails for. Changing the image data type to double in the 'vision/TrackCarsExample' also causes the algorithm to fail.

回答 (0 件)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by