 |
|
 |
Totally cool code, but can't get it to run when compiled in VC 8 or 9.
Compiles OK but get this Assertion:
Debug Assertion Failed!
Program:...
file: c:\program files\microsoft visual studio 8\vc\include\list Line: 213
Expression: list iterator not dereferencable
Tracing through initial program in CListContour class we get: CListContour()
the ctor, Generate(), InitMemory(), many ExportLine(...)'s, a single CompactStrips(), and
several (actually 6) MergeStrips(...) before it comes to a crashing halt. From this, we
might assume that the problem is in the CListContour::MergeStrips(...) function.
Any idea how to fix this ??modified on Tuesday, March 2, 2010 7:44 PM
|
|
|
|
 |
|
 |
Yep, about 6 calls to MergeStrips(). I'm porting the code to C#. Turned out to be out-of-mem error. Fixed that. It looks correct, but now the compacted data looks funny. Maybe I'm just drawing it wrong.
modified on Thursday, May 13, 2010 2:55 AM
|
|
|
|
 |
|
 |
When I press the button save as it show termofuse.aspx. why?
chhhh
|
|
|
|
 |
|
 |
http://snowedforest.brinkster.net
|
|
|
|
 |
|
 |
Hi Jonathan,
I came to know your article while searching for concepts related to contour. Am working as a software engineer in Visual C++ for the past two years. No one is here for me to train. Am reading for myself and doing things as much as my effort makes it possible. Now am in a need to accomplish the following one:
1. I need to show a bitmap in a full screen mode
2. Then i need to scatter that bitmap here and there all over the screen and then have to reassemble it to make it return back to its original form.
I had posted one message asking about this. Then i got the reply to look for finding contours of that bitmap and then to carry on from there. One more reply suggested me to study about 3DMax.
Now i posted this to have your ideas and suggestions. If there any book for me to read and proceed, please refer to me. I am ready to read and implement the procedure.
Thanking you,
With Regards,
Sangeetha.
|
|
|
|
 |
|
 |
Hi,
My email id is Anj.Sangeetha@gmail.com. Looking forward for ur reply through code project or my gmail account.
With Regards,
Sangeetha.
|
|
|
|
 |
|
 |
Hi,
I have notice that in certain cases, the "CompactStrip" method does an infinite loop.
I Have also notice that if you want to draw functions as "sin(x)" you miss somes strips
! If anyone has a correction for that.
For infinite loop problem,I propose a correction in the CompactStrip method :
////////////////////////
Remplace line 326-344:
////////////////////////
// Copying all
for (pos2=newList.begin(); pos2 != newList.end(); pos2++)
{
pStrip=(*pos2);
CLineStrip::iterator pos1 = pStrip->begin(),pos3;
while (pos1!=pStrip->end())
{
pos3 = pos1;
pos3++;
if ( (*pos1) == (*pos3))
pStrip->erase(pos3);
else
pos1++;
}
//if (!(pStrip->front()==pStrip->back() && pStrip->size()==2))
if (pStrip->size()!=1)
m_vStripLists[i].insert(m_vStripLists[i].begin(),pStrip );
else
delete pStrip;
////////////////////////
By this :
////////////////////////
// Copying all
for (pos2=newList.begin(); pos2 != newList.end(); pos2++)
{
pStrip=(*pos2);
CLineStrip::iterator pos1 = pStrip->begin(),pos3;
CLineStrip* copyStrip = new CLineStrip;
while (pos1!=pStrip->end())
{
pos3 = pos1;
pos3++;
if ( (*pos1) != (*pos3)) {
copyStrip->insert(copyStrip->end(),*pos1);
}
pos1++;
}
//if (!(pStrip->front()==pStrip->back() && pStrip->size()==2))
if (copyStrip->size()>1)
m_vStripLists[i].insert(m_vStripLists[i].begin(),copyStrip );
else
delete pStrip;
delete copyStrip;
|
|
|
|
 |
|
 |
I'm running XP and using VisualC++7.1.
I've found that the demo program (both the precompiled exe, and the source when i build it) will crash, the first time it tries to recompute the contours. To reproduce, simply start the program and press 'e'.
In the debugger, it shows the problem is in ListContour.cpp, line 48:
ASSERT(m_vStripLists.size() == GetNPlanes());
these values are 20 and 21, so the ASSERT fails.
Does anyone have a solution? This code looks nice but a crashing demo doesn't bode well.
|
|
|
|
 |
|
 |
Hi Jonathan de Halleux, Belgium.
I am runa. I am from Canada. I am doing my Mastres in Computer Science. I saw your great work. I thought you may help me to solvemy problem. Part of my thesis is to draw contour in a brain image using openGL and C++. the image is a monotone image. I do not know how should I start. Can you give me some guideline? I will be grateful.
Runa
|
|
|
|
 |
|
 |
hello,
does any one a decent algorithm for the extraction/delineation of feature lines e.g. ridges, channels etc. using contour-shapes?
Any comments will be much appreciated.
sanjay.
|
|
|
|
 |
|
 |
hello
i am working on a Image Processing project, i need algo/code on morphology,finding skeleton of a video camera image,Regional descriptors....
can anybody plz guid me
my eamil id is
prit_me@hotmail.com
VC++
|
|
|
|
 |
|
|
 |
|
|
 |
|
 |
I have a series of 3 dimension points,such as (x,y,z).I want to know how to get
my Function(double x, double y){ ?????? }????
thanks !
Good boy!
|
|
|
|
 |
|
 |
Nope, no clue !
Jonathan de Halleux, Belgium.
|
|
|
|
 |
|
 |
Why I can not download?
chhhh
|
|
|
|
 |
|
 |
If you have a grid of (x,y,z) points, try linear (or, maybe, spline) interpolation between points of the grid.
|
|
|
|
 |
|
 |
Thanks a lot for providing the algorithm and codes!
I found they're excellent for image display, but to use the contours to do some real calculation, CListContour::CompactStrips() has to be modified to 1) erase redundant points and strips, 2) connect seperate parts of one closed curve into one CLineStrip. Case 2) happpens when the function is irregular on the scale not much larger than that of the second grid. End points of neighboring strips can be seperated about several m_dDx or m_dDy. So the original MergeStrips doesn't work here.
|
|
|
|
 |
|
 |
Did you already do those improvement ?
I haven't got time anymore to play with contours... If you're willing
to contribute send me your notification and I'll update the article.
|
|
|
|
 |
|
 |
Sure, I added several functions to CListContour for my research purpose, and compiled my program under linux. Besides, there is one possible bug in CContour, once the function SetPlanes is called the pointer m_pPlanes points to memory outside the contour object. When this function is called again or the deconstructor is called, 'delete []m_pPlanes' can cause an error, at least in linux. So I also modified SetPlanes.
I'll send you the modified files.
|
|
|
|
 |
|
 |
Update your code, thanks for contributing.
Anyway, I transformed double* m_pPlanes to vector m_vPlanes, nicer and safer.
Cheers,
Jonathan de Halleux, Belgium.
|
|
|
|
 |
|
 |
How to fill the contour with color or texture? What's order of filling?
|
|
|
|
 |
|
 |
You should modify yourself the CContourGL class.
The problem is to detect closed linestrip and open line strip. Only closed one, can be filled.
I haven't though about the order of filling,
Jonathan de Halleux, Belgium.
|
|
|
|
 |
|
 |
How to fill the contour with color or texture? What's order of filling?
|
|
|
|
 |
|
 |
Filling contours can be tricky since you have open endedness at the boundary of the surface or you may have contours pinching together (or maybe even crossing due to the problems inherent in display discrete data points). You can try a simple flood fill, or you can take consequetive contours and join them up at the ends to form a polygon and then draw the polygon with a fill colour, or you can go all out and discretise the surface using triangulation or some other surface discretisation method and fill each element individually.
My classes in the article "Classes for computational geometry" provide a function to perform Delauney Triangulation that may be of help if you want to go the full blown method.
If you're bored then take a look at DEMView/DEMMaker[^] for an illustration of this in action.
cheers,
Chris Maunder
|
|
|
|
 |