converting coordinates into pixel
조회 수: 4 (최근 30일)
이전 댓글 표시
Hi,
I have a 3D vector attached here (Mydots.mat). the first dimension is the number of spots, the second is the x,y coordinates of each spot and the third is number of frames. in each frame, the white spots are on grey background; basically they are moving across frames as coordinates change.
I would like to convert them in uint8 or double in 3D (Y,X,#frames) or 4D vector (Y,X,3,#frames) with grayscale intensity matrix of dimensions (Y, X) or a color matrix of dimensions (Y, X, 3).
I look at previous forum and didn't exactly get the discussion so I would like to ask again. Thanks.
댓글 수: 0
답변 (1개)
Image Analyst
2022년 10월 25일
Not really sure what you want but I have this so far
s = load('Mydots.mat')
Mydots = s.Mydots;
[numDots, xy, numFrames] = size(Mydots)
for f = 1 : numFrames
thisFrameX = Mydots(:, 1, f);
thisFrameY = Mydots(:, 2, f);
plot(thisFrameX, thisFrameY, 'b.', 'MarkerSize', 15);
grid on;
xlim([-1000, 1000]);
ylim([-600, 600]);
caption = sprintf('Frame# %d of %d', f, numFrames);
title(caption, 'FontSize',16)
drawnow;
pause(0.1)
end
fprintf('Done!\n');
But do you want a volumetric image where some voxels have a gray level (and some are unassigned and thus zero)? If so, how is the gray level to be defined?
Or do you want an N-by-3 or 4 list of all the points like
x1, y1, f1, gl1
x2, y2, f1, gl2
x3, y3, f1, gl3
and so on for the other frames? This would not be a volumetric (3D) image but just a list of data. Again, how are the gray levels to be assigned?
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Convert Image Type에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!