MATLAB Answers

Translated by

このページのコンテンツは英語から自動翻訳されています。自動翻訳をオフにする場合は「<a class="turn_off_mt" href="#">ここ</a>」をクリックしてください。

G. Nardi

Loop that runs through the preprocessed image files and iterate

G. Nardi
さんによって質問されました 2018 年 12 月 11 日
Yes this is for a class and I am trying to learn. I have preprocessed video and now I want to create a loop that will run through each of the image files. In each of these iterations I want to
a. Compare each of the pixel values (height by width) to the average value stored in the average matrix. If the absolute value of the difference is greater than some threshold (start with threshold = 20) set the value of that correspond pixel in the newImage to be white (intensity value 255). If it’s less than the threshold you will set the value of that corresponding pixel in the newImage to be black (intensity value 0). If the pixel value is white, it is a foreground pixel, if it’s set to black, it’s a background pixel.
b. Then update the average matrix by replacing the oldest image in the matrix with the current image.
What I have so far....
for imageNumber = 1 : mov.NumberOfFrames
img = read(mov,imageNumber);
%average frame minus current
averagePixelValue = totalPixelValue / lastTenImage;
go through rows
for x= 1:1080
%go through columns
for y= 1:1920
%get a value of an image of a given pixel.
currentFramePixel = impixel(x,y);

  0 件のコメント

サインイン to comment.

0 件の回答

Translated by