I’m trying to get the coordinates of the ImageData, in term of X and Y separately I have paste my trials and would gratefully need your help.

In 3D, the array generated by ImageData [image] is arranged such that the first part corresponds to the top slice, with rows running from back to front, and columns running from left to right.

cc = ColorConvert[imageOfPalmTree, "Grayscale"];
imageCoordinates = ImageData[cc];
ListPlot3D[imageCoordinates, Mesh -> None]

Export["imageCoordinates.csv", imageCoordinates]

exportStringimageCoordinates = ExportString[imageCoordinates, "Table"];

Export["exportStringimageCoordinates.csv", exportStringimageCoordinates]

enter image description here


Start with a simple example to see how ImageData returns the data in an image.

i = Image[{{0., 1.}, {1., 0.}}]

(* {{0., 1.}, {1., 0.}} *)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.