Hi,
I require the X, Y and Z coordinates separately, in 3 different columns.
I have tried with, Table, Grid and Matrix.
Please let me have an idea how to perform it.
I suppressed the output since there is large amount of data
Thanks
ImageData_x_y_z_Coordinates.nb (247 KB)
imData=ImageData[cc] // Dimensions
{51,27}
I cannot remember the Mathematica data layout for GreyScale data (obviously between 0 and 1, and apparently 1 value per pixel in the cell, arranged by columns and rows I would guess). The format of this and other image formats is on Wolfram’s website in Documentation section and perhaps in Help also.
You need to say what you wish X,Y,Z to be (color? space? color and space?).
Partition[Flatten[x], 3] // Dimensions
Will re-arrange the {51,27} dimension matrix to be {459, 3} in dimension. I’m unsure if that arranged the data as you need it, of course.
When you post on Communities you might want to limit your post length using this:
x // Short
{{0.113725,0.105882,<<24>>,0.121569},<<49>>,{<<1>>}}
Hi, Thank for feedback,
I am doing trial with this example:
The constraint is when I replace 4 with 3, the model, gets distorted.
4 is the good model whereas 3 is Not:
Thanks
ImageData_x_y_z_Coordinates_2.nb (47.3 KB)
This looks very similar to a this question you asked earlier. Why are you partitioning by 3 when the data is 4 x 4?
Hi,
In fact I’m trying to find the surface roughness of an image.
According to ISO 25178 >> https://www.iso.org/obp/ui/#iso:std:iso:25178:-2:ed-1:v1:en >> 4.1: Height Parameters,
the Sa and Sq values are multiplied by X (y,z).
This is I presume to gather the X, Y and Z coordinates to implement the formula.
Thanks for your suggestion
Using the example from ImageData_x_y_z_Coordinates.nb
{yRange, xRange} = imData // Dimensions
Table[{x, y, imData[[y, x]]}, {x, xRange}, {y, yRange}] // Flatten[#, 1] &
evaluates to a list of {x, y, z} where z is the pixel value corresponding to coordinates x, y and 1, 1 is the top left of the image and 27, 51 is the bottom right of the image.