create an image with black background from extracted pixel values

조회 수: 1 (최근 30일)
Anastasia
Anastasia 2020년 1월 13일
편집: KALYAN ACHARJYA 2020년 1월 14일
Hello everybody.
I created a selection of an image in imagej and obtained a .csv file from imagej that contains the x and y position for each pixel and its value (attached file, the image initially containted 9604 pixels: 98x98). I would like to create a new image with a size of 150x150 pixels which has black background, onto which i might put my "selected object" using the x-y and intensity values for the pixels of the object.
Could you please help me? Please do not hesitate to ask me further questions.
Thank you very much!

답변 (1개)

KALYAN ACHARJYA
KALYAN ACHARJYA 2020년 1월 14일
편집: KALYAN ACHARJYA 2020년 1월 14일
%Lets suppose you have image1 as main image
image1=ones(150,150);
subplot(121),imshow(image1); title('Main');
r=randi(150,[1,20]); % Get the row data from CSV file-Pixel Position
c=randi(150,[1,20]); % Get the column data from CSV file-Pixel Position
image1(r,c)=0;
subplot(122),imshow(image1);title('After pixels localised');

카테고리

Help CenterFile Exchange에서 Biomedical Imaging에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by