Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

crash of convhulln

181 views
Skip to first unread message

Sandro

unread,
Mar 1, 2011, 1:18:20 PM3/1/11
to
Dear all,

I have met an issue which I believe needs posting here as a feedback of using convhulln, and if there is any solution or updated version, please give me a clue.

The issue is as titled. Matlab crashes in some large data set when I use vert2con function. It calls convhulln built in function, and convhulln calls qhullmx function. I debugged for a while and find the crash is due to qhullmx.

My data set is not too large, for instance 66*11 as input for vert2con. Also, the same size data set (not the same data set) can return results sometime. The troubling data set should form a pretty small convex hull. When the hull is bigger, vert2con works fine.

I guess qhull may have some bugs, but that's sort of beyond my focus.

Thanks for any suggestion.

Best,
Sandro

ImageAnalyst

unread,
Mar 1, 2011, 1:22:55 PM3/1/11
to

------------------------------------------
There are several routines that internally allocate scratch memory
arrays based on the size of the array you're passing in. Sometimes
you will get out of memory errors. A workaround that may work is to
subsample and then scale up when it's all done. Or else see this:
http://www.mathworks.com/support/tech-notes/1100/1107.html

Steven_Lord

unread,
Mar 1, 2011, 1:24:03 PM3/1/11
to

"Sandro " <chin...@gmail.com> wrote in message
news:ikjd9b$3l5$1...@fred.mathworks.com...

I don't see any function named VERT2CON listed in the documentation. Please
send your data set, the exact command you use to call VERT2CON, the VERT2CON
function (and any helper functions required to run VERT2CON) and the output
of the VER function to Technical Support so that they can further
investigate the cause of this crash. Alternately, if you can determine
exactly how VERT2CON calls CONVHULLN and send Support the syntax and data
for that call, you wouldn't need to send VERT2CON.

--
Steve Lord
sl...@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Matt J

unread,
Mar 1, 2011, 1:52:07 PM3/1/11
to
"Sandro" wrote in message <ikjd9b$3l5$1...@fred.mathworks.com>...

>
> My data set is not too large, for instance 66*11 as input for vert2con. Also, the same size data set (not the same data set) can return results sometime. The troubling data set should form a pretty small convex hull. When the hull is bigger, vert2con works fine.
==========

That seems like a pretty large computation. For example, when I ran on only 9-dimensional data it took over 10 sec. and generated 6 MB of constraint data.

tic; [A,b]=vert2con(rand(66,9)); toc
Elapsed time is 12.898464 seconds.

Name Size Kilobytes Class Attributes

A 83114x9 5843.9531 double
b 83114x1 649.3281 double


Also, if the convex hull is "small" it might be hard for the program to distinguish between solid and non-solid data, like in the following:

>> V=[0,0 0 ; 1 0 0 ; 1 0 0 ; 1 1 0]

V =

0 0 0
1 0 0
1 0 0
1 1 0


>> [A,b]=vert2con([V])


??? Error using ==> qhullmx
The data is degenerate in at least one dimension - ND set of points lying in (N+1)D space.

Error in ==> convhulln at 65
[k,vv] = qhullmx(x', opt);

Error in ==> vert2con at 46
k = convhulln(V);

Sandro

unread,
Mar 2, 2011, 11:51:05 PM3/2/11
to
I think it should be fine if it works slow or return a warning. But it crashed my matlab directly. See the following message:
********
------------------------------------------------------------------------
Segmentation violation detected at Wed Mar 02 23:37:41 2011
------------------------------------------------------------------------

Configuration:
MATLAB Version: 7.10.0.499 (R2010a)
MATLAB License: 161051
Operating System: Microsoft Windows XP
Window System: Version 5.1 (Build 2600: Service Pack 3)
Processor ID: x86 Family 6 Model 7 Stepping 6, GenuineIntel
Virtual Machine: Java 1.6.0_12-b04 with Sun Microsystems Inc. Java HotSpot(TM) Client VM mixed mode
Default Encoding: windows-1252

Fault Count: 1

Register State:
EAX = 00000014 EBX = 00000002
ECX = 00000000 EDX = 00000001
ESI = 63207265 EDI = 00002000
EBP = 00000000 ESP = 00c2c418
EIP = 7c757450 FLG = 00010206

Stack Trace:

This error was detected while a MEX-file was running. If the MEX-file
is not an official MathWorks function, please examine its source code
for errors. Please consult the External Interfaces Guide for information
on debugging MEX-files.

If this problem is reproducible, please submit a Service Request via:
http://www.mathworks.com/support/contact_us/ts/help_request_1.html

A technical support engineer might contact you with further information.

Thank you for your help. MATLAB may attempt to recover, but even if recovery appears successful,
we recommend that you save your workspace and restart MATLAB as soon as possible.

Caught MathWorks::System::FatalException
[Please exit and restart MATLAB]>>
********

"Matt J" wrote in message <ikjf8n$cja$1...@fred.mathworks.com>...

Jean Du'g'nou

unread,
Sep 10, 2015, 5:30:10 AM9/10/15
to
Dear all,

I’m using a GUI that analyses 3D point clouds data. When it load the data, the GUI try to fit a convex hull. This process does not work with my data, and matlab return the following error message :

Error using qhullmx
The data is degenerate in at least one dimension - ND set of points lying in (N+1)D space.

Error in convhulln (line 65)
[k,vv] = qhullmx(x', opt);

There is very little information about the qhullmx function and this error message; I cannot manage to find a solution. My dataset contains 3 columns (X, Y, Z) and about 13,000 lines. Each line is a 3D point (the center of a voxel, actually). My points were initially integers (eg., 1,1,1) and I thought it might be a problem, so I added a random number (sampled from a normal distribution N ~ (0.5,0.5)) to each coordinates, just to add some noise and see whether it would solve the problem. It does not.

Would anyone have a clue about what I might do to investigate this issue?

Cheers



"Sandro" wrote in message <ikjd9b$3l5$1...@fred.mathworks.com>...

Steven Lord

unread,
Sep 10, 2015, 10:31:27 AM9/10/15
to


"Jean Du'g'nou" <tacs...@yahoo.fr> wrote in message
news:msriis$qpc$1...@newscl01ah.mathworks.com...
> Dear all,
>
> I’m using a GUI that analyses 3D point clouds data. When it load the data,
> the GUI try to fit a convex hull. This process does not work with my data,
> and matlab return the following error message :
>
> Error using qhullmx
> The data is degenerate in at least one dimension - ND set of points lying
> in (N+1)D space.
>
> Error in convhulln (line 65)
> [k,vv] = qhullmx(x', opt);
>
> There is very little information about the qhullmx function and this error
> message; I cannot manage to find a solution. My dataset contains 3 columns
> (X, Y, Z) and about 13,000 lines. Each line is a 3D point (the center of a
> voxel, actually). My points were initially integers (eg., 1,1,1) and I
> thought it might be a problem, so I added a random number (sampled from a
> normal distribution N ~ (0.5,0.5)) to each coordinates, just to add some
> noise and see whether it would solve the problem. It does not.
>
> Would anyone have a clue about what I might do to investigate this issue?

This isn't really related to the main topic of this thread, which had to do
with a crash in CONVHULLN. In your case, CONVHULLN throws an error and does
not crash. But anyway ...


You have a set of data consisting of X, Y, and Z coordinates. But what if
all your data points were measured by placing the measuring device at a
certain point on top of a table? While your data would LOOK like it has 3
dimensions since each point has 3 coordinates, it's actually 2 dimensional
data.

This is a very simplified version of what I suspect is happening in your
CONVHULLN call. But this type of problem can occur even if the Z coordinates
of your data points are different -- consider leaning a plank of wood
against the wall and putting your coordinate sensor at various points on its
surface. To check if this is what's happening, SCATTER3 your data and rotate
it around. If you can see a view where the data looks like a plane (or even
worse a straight line) that would explain this error. For instance,
consider:

>> [x, y] = meshgrid(1:100);
>> z = 3 - 2*x - 4*y;
>> scatter3(x(:), y(:), z(:))

You can rotate this around until you can look "along the tabletop". If you
tried to use CONVHULLN on the matrix [x(:), y(:), z(:)] you'd get a rather
verbose message that more or less boils down to the same problem your
message described.

*snip*
0 new messages