Clear Filters
Clear Filters

How can I get a XY Coordinate, XZ coordinate from images and combine these into one matrix?

1 view (last 30 days)
I'm trying to make a point cloud image of a fruit.
First, using a picture taken at the front of a fruit I want to get a X,Y coordinates
and from a picture taken at the top of a fruit I want to get a X,Z coordinates.
Then, I would like to combine these two into one matrix and use it for making point cloud image.
Consider that a fruit was taken at a white canvas and it look almost round when it is seen at the top, but somewhat long at the front.
So, I don't know how to get coordinates by a image and how to make a 3 row matrix from these coordinates.
The codes I know are only these codes.
imread('fruit.jpg');
load('xyzPoints');
ptCloud = pointCloud(xyzPoints);
pcshow(ptCloud)

Answers (1)

Andreas Bernatzky
Andreas Bernatzky on 18 Apr 2019
Edited: Andreas Bernatzky on 18 Apr 2019
Hey Lee,
I am not really familiar with image processing, but it sounds quiet simple for me.
My example: just look at google for it :)
Thats my suggestion for a simple approach:
img=imread('Apfel.jpg');
colorMap = squeeze( img(:,:,1) ); %1= red colorcode, 2= green color code, 3= blue color code
threshold = 240;%adjust your threshold
XZPlane= find(colormap<threshold); % All relevant points
Do this for your 3 planes and fit them together.

Tags

Community Treasure Hunt

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

Start Hunting!