[Visual C++]Erreur à l'execution avec des dll

Jim_Nastiq -  
 gassi64 -
salut,


j'ai un probleme sous visual(je decouvre ce logiciel!) mon programme compil mais lorsque je veux l'executer la console s'affiche puis disparait quasi directement et j'ai ensuite un tas d'erreur du genre :

'joao.exe' : Chargé 'C:\WINDOWS\system32\SynTPFcs.dll', Le fichier binaire n'a pas été généré avec les informations de débogage.
'joao.exe' : Chargé 'C:\WINDOWS\system32\MSCTFIME.IME', Aucun symbole n'a été chargé.


et pour finir la derniere erreur est :

Le programme '[3796] joao.exe: Natif' s'est arrêté avec le code -1 (0xffffffff).

si qq'un peut m'aider,merci!

voici mon code :

#include "BlobResult.h"
#include <cv.h>
#include <highgui.h>
//#pragma comment(lib, "cvblobslib.lib")
//#include <stdafx.h>
int main()
{
    CBlobResult blobs;
    IplImage* bin_segmented_image = 0;
    IplImage* outputImage = 0;
    IplImage* frame = 0;

    cvNamedWindow("Blobs Painted of Red", CV_WINDOW_AUTOSIZE);
    cvNamedWindow("Original", CV_WINDOW_AUTOSIZE);
    cvNamedWindow("Objects Detected", CV_WINDOW_AUTOSIZE);
 
if((bin_segmented_image = cvLoadImage("blob.bmp",-1)) == 0)
return-1;
    cvShowImage("Original", bin_segmented_image);
    cvWaitKey(400);
 
    outputImage = cvCloneImage(bin_segmented_image);
    frame =cvCloneImage(bin_segmented_image);
 
    blobs = CBlobResult( bin_segmented_image, NULL, 100, true);
 
//blobs.PrintBlobs( "c:\\tmp\\blobs.txt" );

int num_blobs = blobs.GetNumBlobs();
 
//40 is the min area, and 20000 the max area.
    blobs.Filter( blobs, B_INCLUDE, CBlobGetArea(),  B_INSIDE, 40 , 20000);

//blobs.PrintBlobs( "c:\\tmp\\filteredBlobs.txt" );

    num_blobs = blobs.GetNumBlobs();
 
    CBlob blob;
 
    CvPoint rect_vertice_1, rect_vertice_2;   
 
for(int b = 0; b < num_blobs; b++)
{
       blob = blobs.GetBlob(b);
       blob.FillBlob( outputImage, cvScalar(125), 0, 0);

       rect_vertice_1.x = (int)blob.MinX();
       rect_vertice_1.y = (int)blob.MinY();

       rect_vertice_2.x = (int)blob.MaxX();
       rect_vertice_2.y = (int)blob.MaxY();

// 'frame' is the original IplImage image(3 channels).
 
      cvRectangle( frame, rect_vertice_1, rect_vertice_2, cvScalar(125), 1, 8, 0);   
//cvRectangle( bin_segmented_image, rect_vertice_1, rect_vertice_2, CV_RGB(0, 255, 0), 1, 8, 0 );   
}
 
 
    cvShowImage("Blobs Painted of Red", outputImage);   
 
//blobs.ClearBlobs();
 
    cvShowImage("Objects Detected", frame);

	cvWaitKey(800);
return(1);
}
 
A voir également:

1 réponse

gassi64
 
Build intructions

cvBlobsLib has been developed using Microsoft Visual C++ (6.0) and also can be used in .NET. A Linux version could be downloaded here.

cvBlobsLib is distributed in a static library (.lib). To use it, it is needed to build the .lib file and later use that lib file in the desired project. To build the .lib file, simply open the MSVC++ project and build it (debug or release version).

To build the project where the library is to be used follow this steps (MSVC++ 6.0):

    *
      In "Project/Settings/C++/Preprocessor/Additional Include directories" add the directory where the blob library is stored
    *
      In "Project/Settings/Link/Input/Additional library path" add the directory where the blob library is stored and in "Object/Library modules" add the cvblobslib.lib file
    *
      Include the file "BlobResult.h" where you want to use blob variables.
    *
      In "Project/Settings/C++/Precompiled Headers" select "Not use precompiled headers" (Thanks Brendan) 
NOTE: Verify that in the project where the cvblobslib.lib is used, the MFC Runtime Libraries are not mixed:

   1.
      Check in "Project->Settings->C/C++->Code Generation->Use run-time library" of your project and set it to
   2. Debug Multithreaded DLL (debug version) or to Multithreaded DLL ( release version ).
         1.

            Check in "Project->Settings->General" how it uses the MFC. It should be "Use MFC in a shared DLL". 

NOTE: The library can be compiled and used in .NET using this steps, but the menu options may differ a little

NOTE 2: In the .NET version, the character sets must be equal in the .lib and in the project. [OpenCV yahoo group: Msg 35500]
0