Create line of pixels on an image
21 views (last 30 days)
I am trying to achieve the Two Point Correlation function for a distribution of grain sizes.
As a practice example, I have generated mimic grain diagram using voronoi.
x = rand([1 100]);
y = rand([1 100]);
What I am now trying to achieve is to pick a line across the bulk of the image and have this line made of say around 1000 pixels. Each pair of pixels will be separated by some distance 'r'. Then I would then like to know how many pixels belong to each grain. (Different grains will have different pixel values.)
I have researched using the line command amongst other things but I can't get anything close to what I need. Any help would be appreciated.
Image Analyst on 14 Sep 2022
Does the orientation of the line matter? I think not. So why don't you just scan down the image line by line. To find out how many pixels are in each grain intensity you can take the histogram. Of course if you scan down the entire image that will just give you the histogram of the entire image. Not really sure what you're after. Do you just want to know the area fraction of a certain grain type? Not sure what you mean by having pixels separated "r" from the line. Wouldn't that just mean you have two lines? Is that because you're trying to determine the likelihood of one grain type being adjacent to another grain type?