Ask Your Question

IplImage vector in C++/Clr

asked 2013-06-03 09:35:39 -0500

123ezone gravatar image

I have converted a console application of a OCR application to a windows form application.The program runs accurately on console application but after converting it gives error for the vector that I have used to store image set.I have changed the configuration properties to Common Language Runtime Support (/clr) and I changed the header file cliext since clr does not support for std/vector. This is my code.But still it has errors.

ref class Segmentation { public:
    IplImage *PreprocessedImage;
    cliext::vector<IplImage *> Lineimgs;
    cliext::vector<IplImage *> Characterimgs;
    Segmentation(IplImage *);
    IplImage* Resize(IplImage *);
    void Horizontal_projection(int,int,int,int
    int Vertical_Projection(int,int); };``

Error is, Error 1 error C3225: generic type argument for 'TValue' cannot be '_IplImage *', it must be a value type or a handle to a reference type C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cliext\vector 14 1 Prototype 3

Please help me with this problem.Thank You

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2013-06-03 09:47:08 -0500

Basically the vector type desires you to input an object type, not a pointer to an object type. If you would replace the following lines

cliext::vector<IplImage *> Lineimgs;
cliext::vector<IplImage *> Characterimgs;


cliext::vector<IplImage> Lineimgs;
cliext::vector<IplImage> Characterimgs;

then the error should disappear.

On the other hand, why do you use pointers to IplImages if you want to use C++ code and C++ style interfacing. OpenCV switched to using the Mat object type which can be easily combined with the vector object.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools


Asked: 2013-06-03 09:35:39 -0500

Seen: 626 times

Last updated: Jun 03 '13