필터 지우기
필터 지우기

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