Thread Subject: delaunay

Subject: delaunay

From: hajoura

Date: 24 Apr, 2009 07:51:07

Message: 1 of 11

Good morning,
I'm trying to use the command delauny3 in matlab , but it doesn't
work,
I don't know exactly where is the problem.
the parameters of this command are 3 vectors with same size?
please help me to solve this problem
thank u

Subject: delaunay

From: Gavrilo Bozovic

Date: 24 Apr, 2009 08:13:03

Message: 2 of 11

hajoura <fradi.hajer@gmail.com> wrote in message <ae08d7b0-bcc0-4d20-bc6d-0e1d48c936db@c12g2000yqc.googlegroups.com>...
> Good morning,
> I'm trying to use the command delauny3 in matlab , but it doesn't
> work,
> I don't know exactly where is the problem.
> the parameters of this command are 3 vectors with same size?
> please help me to solve this problem
> thank u

try "help delanay3"...

Subject: delaunay

From: hajoura

Date: 24 Apr, 2009 08:21:53

Message: 3 of 11

thank u,
but i tried the help.
i think there is a problem with the parametrs of this function, may be
there are other constraints in using this command

Subject: delaunay

From: Gavrilo Bozovic

Date: 24 Apr, 2009 08:30:21

Message: 4 of 11

hajoura <fradi.hajer@gmail.com> wrote in message <c9e58d8c-3df9-4e99-8a84-ce62a4a432db@f19g2000yqo.googlegroups.com>...
> thank u,
> but i tried the help.
> i think there is a problem with the parametrs of this function, may be
> there are other constraints in using this command

You have to give delaunay3 three vectors of equal size.

Now what are the inputs you give to the function, and what is the error you're getting?? You have to give more info if you want an answer..

Subject: delaunay

From: hajoura

Date: 24 Apr, 2009 08:58:43

Message: 5 of 11

ok,
i'm trying to use triangulation of delaunay to achieve super
resolution.
i read article "High Resolution Image Formation From Low Resolution
Frames Using Delaunay Triangulation".after that, i find the
implementation of this method in
http://www.tsi.enst.fr/tsi/enseignement/ressources/mti/delaunay/delaunay_imprimable.pdf,
in this paper, they start with high resolution image , than they
undersampled this image, they obtain 5 low resoltion images.
lt = lr1 + lr2 + lr3 + lr4 + lr5; It contain the information from the
5 images
after that, they use the function delaunay;
i didn't understand also why they use meshgrid
For me, i want to use only 2 undersampled image
my code:
img=imread('----------');
i1=1;
j1=1;
i2=3;
j2=3;
M=M/4
N=N/4
%undersampling the image
im1(i1:1:M,j1:1:N)=img(i1:4:4*M,j1:4:4*N);
im2(i1:1:M,j1:1:N)=img(i2:4:4*M,j2:4:4*N);

image=im1+im2;
image=image(:)';
i1=1;
j1=1;
[X_1,Y_1]=meshgrid(i1:4:4*M, j1:4:4*N);
X1=X_1(:)';
Y1=Y_1(:)';
TRID=delaunay3(X1, Y1, image, {'QJ'});

So, two questions 1)why we use meshgrid in this case?
                           2)why the function delaunay3 work ?

Subject: delaunay

From: hajoura

Date: 24 Apr, 2009 09:01:27

Message: 6 of 11

the message of errors:

??? The first input argument must be a double array.

Error in ==> delaunayn at 81
t = qhullmx(x', 'd ', opt);

Error in ==> delaunay3 at 45
    t = delaunayn([x(:) y(:) z(:)],options);

Error in ==> Trinagulation_Delaughay at 59
TRID=delaunay3(X1,Y1,image, {'QJ'});

Subject: delaunay

From: John D'Errico

Date: 24 Apr, 2009 13:14:01

Message: 7 of 11

hajoura <fradi.hajer@gmail.com> wrote in message <495b7f4c-89e1-4b33-a1dc-312f72290749@a7g2000yqk.googlegroups.com>...
> ok,
> i'm trying to use triangulation of delaunay to achieve super
> resolution.
> i read article "High Resolution Image Formation From Low Resolution
> Frames Using Delaunay Triangulation".after that, i find the
> implementation of this method in
> http://www.tsi.enst.fr/tsi/enseignement/ressources/mti/delaunay/delaunay_imprimable.pdf,
> in this paper, they start with high resolution image , than they
> undersampled this image, they obtain 5 low resoltion images.
> lt = lr1 + lr2 + lr3 + lr4 + lr5; It contain the information from the
> 5 images
> after that, they use the function delaunay;
> i didn't understand also why they use meshgrid
> For me, i want to use only 2 undersampled image
> my code:
> img=imread('----------');
> i1=1;
> j1=1;
> i2=3;
> j2=3;
> M=M/4
> N=N/4
> %undersampling the image
> im1(i1:1:M,j1:1:N)=img(i1:4:4*M,j1:4:4*N);
> im2(i1:1:M,j1:1:N)=img(i2:4:4*M,j2:4:4*N);
>
> image=im1+im2;
> image=image(:)';
> i1=1;
> j1=1;
> [X_1,Y_1]=meshgrid(i1:4:4*M, j1:4:4*N);
> X1=X_1(:)';
> Y1=Y_1(:)';
> TRID=delaunay3(X1, Y1, image, {'QJ'});
>
> So, two questions 1)why we use meshgrid in this case?
> 2)why the function delaunay3 work ?

I had to go to the reference to understand your
goal here. Of course, since it is in French, and
my command of that language is limited to what
I learned in 7th grade, I'm surprised that I got
anything out of it. 8-)

You do NOT want to use delaunay3. Delaunay3 is
for a three dimensional object. Your problem lies
in two dimensions, i.e., the (x,y) plane of
coordinates in an image. If you look at the
reference that you provided, see that they use
delaunay, NOT delaunay3 ! Re-read the paper
more carefully.

Delaunay will build a triangulation of the (x,y)
domain of the composite images, then you can
interpolate within that triangulation. There is a
bit more to the paper, but my French is too poor
to really know if I like what they are trying to do
in the paper.

Your other question is why do you use meshgrid?
Look at what meshgrid generates. It gives the
set of pixel coordiantes for a rectangular image
array. This is what delaunay will use to build the
triangulation.

John

Subject: delaunay

From: hajoura

Date: 24 Apr, 2009 13:56:35

Message: 8 of 11

Thank u,
yes , i know that they used delaunay not delaunay3, but this paper
contain a lot of mistakes.
for example , they use delaunay and with 3 parametrs X,Y, IT. so, it
's so clear it is false,
 that's why, i think that the command is delaunay3.
Ok, let's forget this paper, u said that we can interpolate within
that triangulation.; ok,
i have two low resolution images about the same scene and i want to
interpolate them
using the triangulation of delaunay ;how can i do that?

Subject: delaunay

From: John D'Errico

Date: 24 Apr, 2009 14:25:05

Message: 9 of 11

hajoura <fradi.hajer@gmail.com> wrote in message <83b5d771-5ab9-45fd-9cb1-4efe819ea633@k2g2000yql.googlegroups.com>...
> Thank u,
> yes , i know that they used delaunay not delaunay3, but this paper
> contain a lot of mistakes.

Unfortunate that my French is so poor.

> for example , they use delaunay and with 3 parametrs X,Y, IT. so, it
> 's so clear it is false,
> that's why, i think that the command is delaunay3.

It is definitely not appropriate to use delaunay3 here.


> Ok, let's forget this paper, u said that we can interpolate within
> that triangulation.; ok,
> i have two low resolution images about the same scene and i want to
> interpolate them
> using the triangulation of delaunay ;how can i do that?

Sorry. I was wrong to say tsearch. You would use
tsearchn.

You have two images, offset from each other.

1. Combine the two sets of pixel coordinates,
each built using meshgrid.

2. Use delaunay to build a triangulation of the
combined image space.

3. Use tsearchn to give the index of the triangle
in the triangulation that contains a given point.
tsearchn also returns a set of barycentric weights
or coordinates for that point within the triangle.
Apply those weights to the image values at the
vertices of the indicated triangle.

For a random example, since I don't have an image...

x = rand(100,1);
y = rand(100,1);
z = exp(x+y);
tri = delaunay(x,y);

Now, interpolate the resulting surface at some
candidate point. For example, (0.5, 0.5).

[T,P] = tsearchn([x,y],tri,[0.5 0.5])
T =
   188
P =
      0.62224 0.0048745 0.37289

The point lies in triangle 188.

zpred = z(tri(T,1))*P(1);
for i = 2:3
  zpred = zpred + z(tri(T,i))*P(i);
end

Our prediction is

zpred =
       2.7243

How well did we do?

exp(0.5 + 0.5)
ans =
       2.7183

John

Subject: delaunay

From: hajoura

Date: 24 Apr, 2009 15:24:14

Message: 10 of 11

I thank u a lot for ur help; really i m so grateful!

Subject: delaunay

From: Bc

Date: 9 Feb, 2010 20:31:02

Message: 11 of 11

"John D'Errico" <woodchips@rochester.rr.com> wrote in message <gssi41$igm$1@fred.mathworks.com>...
> hajoura <fradi.hajer@gmail.com> wrote in message <83b5d771-5ab9-45fd-9cb1-4efe819ea633@k2g2000yql.googlegroups.com>...
> > Thank u,
> > yes , i know that they used delaunay not delaunay3, but this paper
> > contain a lot of mistakes.
>
> Unfortunate that my French is so poor.
>
> > for example , they use delaunay and with 3 parametrs X,Y, IT. so, it
> > 's so clear it is false,
> > that's why, i think that the command is delaunay3.
>
> It is definitely not appropriate to use delaunay3 here.
>
>
> > Ok, let's forget this paper, u said that we can interpolate within
> > that triangulation.; ok,
> > i have two low resolution images about the same scene and i want to
> > interpolate them
> > using the triangulation of delaunay ;how can i do that?
>
> Sorry. I was wrong to say tsearch. You would use
> tsearchn.
>
> You have two images, offset from each other.
>
> 1. Combine the two sets of pixel coordinates,
> each built using meshgrid.
>
> 2. Use delaunay to build a triangulation of the
> combined image space.
>
> 3. Use tsearchn to give the index of the triangle
> in the triangulation that contains a given point.
> tsearchn also returns a set of barycentric weights
> or coordinates for that point within the triangle.
> Apply those weights to the image values at the
> vertices of the indicated triangle.
>
> For a random example, since I don't have an image...
>
> x = rand(100,1);
> y = rand(100,1);
> z = exp(x+y);
> tri = delaunay(x,y);
>
> Now, interpolate the resulting surface at some
> candidate point. For example, (0.5, 0.5).
>
> [T,P] = tsearchn([x,y],tri,[0.5 0.5])
> T =
> 188
> P =
> 0.62224 0.0048745 0.37289
>
> The point lies in triangle 188.
>
> zpred = z(tri(T,1))*P(1);
> for i = 2:3
> zpred = zpred + z(tri(T,i))*P(i);
> end
>
> Our prediction is
>
> zpred =
> 2.7243
>
> How well did we do?
>
> exp(0.5 + 0.5)
> ans =
> 2.7183
>
> John
=======================================
Hi everyone,

So I was reading your comments and I wanted to ask elaboration on this topic. I have also image matrices I would like to combine, so I have been trying to figure out how to do this. I tried putting them together by putting one column on one matrix followed by the corresponding column of the other matrix, but this cause my result to be larger ont he horizontal only.

For example, I image that there must be a way to combine 4 images that are of some size(4x4) into one large one that is 16x16, right? What methods are there to do this? Any functions?

Tags for this Thread

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.

rssFeed for this Thread
 

MATLAB Central Terms of Use

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 Terms prior to use.

Contact us at files@mathworks.com