Message Boards Message Boards

Obtain X,Y, Z coordinates from a gray scale image separately?

Posted 4 years ago

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

Attachments:
POSTED BY: Manoj Imrith
5 Replies
Posted 4 years ago

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 suggestionenter image description here

Attachment

Attachments:
POSTED BY: Manoj Imrith
Posted 4 years ago

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.

POSTED BY: Rohit Namjoshi
Posted 4 years ago

This looks very similar to a this question you asked earlier. Why are you partitioning by 3 when the data is 4 x 4?

POSTED BY: Rohit Namjoshi
Posted 4 years ago

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

Attachments:
POSTED BY: Manoj Imrith
Anonymous User
Anonymous User
Posted 4 years ago

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>>}}
POSTED BY: Anonymous User
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract