Using double precision with vision.ForegroundDetector
조회 수: 1 (최근 30일)
이전 댓글 표시
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
답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!