Skip to Main Content Skip to Search
Login
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Thread Subject: 3d image surface normals

Subject: 3d image surface normals

From: kıvılcım

Date: 13 Feb, 2008 13:44:02

Message: 1 of 2

 
   Hi everyone,

I work on 3d face images.I have x,y,z points in raster
form.I need to find the surface normals of these images for
my project. Firstly I need to apply polgonal mesh I
think.But I can not any idea how to do this and obtain
surface normals.Is there any one to help me???

Subject: Re: 3d image surface normals

From: Roger Stafford

Date: 13 Feb, 2008 20:49:03

Message: 2 of 2

"kıvılcım " <kvlcm_helhel@mathworks.com> wrote in
message <fous72$b2o$1@fred.mathworks.com>...
>
> Hi everyone,
>
> I work on 3d face images.I have x,y,z points in raster
> form.I need to find the surface normals of these images for
> my project. Firstly I need to apply polgonal mesh I
> think.But I can not any idea how to do this and obtain
> surface normals.Is there any one to help me???
---------
  Here is a possible answer to your question. Suppose A is a 9 by 3 array with
each row containing the (x,y,z) coordinates of one of nine points in your
raster data, where these points consist of one point where you seek the
surface normal, along with its eight neighboring points. That is, within your
raster form, the nine points presumably form a square when projected onto
the x,y plane, with the central point being the one for which a normal is to be
found.

  The normal to an orthogonal least squares best-fitting plane through these
nine points can be regarded as a first order approximation to the surface
normal direction at the central point. If that is a suitable approximation for
you, this problem can be easily solved using matlab's svd function.

 [U,S,V] = svd(A,0); % "economy" version of svd
 n = V(:,3); % Choose eigenvector with least eigenvalue
 n = sign(n(3))*n; % Choose "upwards" as plus direction

  The vector n will be a unit vector orthogonal to the best-fitting plane. That
is, it consists of the three direction cosines of the approximate normal
direction. (The adjustment in the last line is due to the ambiguity as to which
of two opposite directions is chosen by svd. The above ensures that n has a
positive z-component.)

  Of course, you will need to repeat all of this for each point in the surface
data.

Roger Stafford

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
surface normals kıvılcım 13 Feb, 2008 08:45:12
3d image kıvılcım 13 Feb, 2008 08:45:12
polgonal mesh kıvılcım 13 Feb, 2008 08:45:12
rssFeed for this Thread

envelope graphic E-mail this page to a colleague

Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.
Related Topics