Images in Digital micrograph

Hi,
I would like to extract the dark pixels of an DM3 image. For that I thought to get the line profile and set a threshold. Each pixel below the certain threshold would be identified as a "dark" pixel. Now my question: How can I draw such line profiles atomatically?

Respuestas (2)

Image Analyst
Image Analyst el 5 de Mzo. de 2017

0 votos

You can use line() to draw lines in the overlay above an image. You might like to look at improfile(). What is your definition of "automatically"?
To get the dark pixels, you can mask bright pixels to 0
brightPixels = grayImage > someValue;
grayImage(brightPixels) = 0;
imshow(grayImage, []);
Antonio Sereira
Antonio Sereira el 6 de Mzo. de 2017

0 votos

Hi, I extracted the data of the image and I got now a big matrix. I plot them and choose only certain columns. If I want to set a threshold and separate the data below and above the threshold into new matrices, I could solve the problem. What kind of function should I use? It is clear that I should use a for loop but how to set a threshold and save them into two different groups?

6 comentarios

Image Analyst
Image Analyst el 6 de Mzo. de 2017
Is this an "Answer" to your original question up top?
What is the "data"? And how did you "plot" it?
Antonio Sereira
Antonio Sereira el 6 de Mzo. de 2017
Hi,
The data is from a spectrum that we get for each pixel. plot(A(1:#rows,200:250)'). Do you know how to separate the rows below a certain threshold and save them in a matrix?
Image Analyst
Image Analyst el 6 de Mzo. de 2017
What does that mean? What if some values in the row are above and some below. What do you want to save? What is row 1 has 48 values above, row 2 has 183 values above, and row 3 has 935 values above, so the number is different for each row. What do you want to save, and how do you want it saved?
Antonio Sereira
Antonio Sereira el 7 de Mzo. de 2017
Hi,
I extracted the last 35 columns, and summed each row. In that way I got a vector of length 10000. Now I converted it to a 100x100 matrix where the element (1,1) corresponds to pixel [x,y]=[1,1]. This means I have a new data cube with summed values as the third coordinate (z-axis). Now I set also a threshhold. Z-values above it should be bright and below dark. How I can save the z values above and below for all 10000 numbers?
Not quite sure I understand. You lost me when you said that you took an average vertical profile (1-D of 1000 elements) and turned it into a 100x100 2-D array and then called that a "data cube" which, to me, means a 3-D array, not a 2-D array. Did you subsample and replicate? Just reshape()? Is this something like meshgrid() produces? I have no idea what went on.
A small 4 by 4 by 3 slice example might help.
In general to extract values according to their value, try thresholding:
indexesToExtract = z >= lowValue & z <= highValue;
extractedZ = z(indexesToExtract);
where z is a 1-d vector.
Antonio Sereira
Antonio Sereira el 19 de Mzo. de 2017
Hi,
to get more clear: I set two for loops (for i=1:100 and j=1:100) and put in the for loop a if condition. If value is above threshold than save it into matrix A(i,j). Now, Matrix A corresponds to certain k-values of a hyperspectral data cube B (three dimensional array). I want to correlate the pixel (i,j) of A with B(i,j,k) so that I only have values for (i,j) whose values are above the threshold and zero else. A simple matrix dot product is not possible. Any idea?

Iniciar sesión para comentar.

Preguntada:

el 5 de Mzo. de 2017

Comentada:

el 19 de Mzo. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by