Ask Your Question

sidPhoenix's profile - activity

2020-04-23 08:23:11 -0600 received badge  Popular Question (source)
2015-06-03 04:43:16 -0600 received badge  Enthusiast
2015-06-01 00:16:38 -0600 commented question How to convert unsigned int to unsigned char* in C++ ?

But edgeImage is Mat type. I cannot use widthStep or imageData functions for that. I have used their alternatives - (edgeImage.data + row * edgeImage.step) this is working fine. Thanks.

2015-05-31 07:27:15 -0600 commented question How to convert unsigned int to unsigned char* in C++ ?

I have done all the conversions- converting all IplImage objects to Mat objects and finding equivalent functions. I think there is a problem in this version- this kind of definition was working for IplImage objects but is not working on Mat objects. Can u help me in that conversion?

2015-05-30 06:39:04 -0600 received badge  Editor (source)
2015-05-30 06:37:34 -0600 asked a question How to convert unsigned int to unsigned char* in C++ ?
    const uchar* ptr = (const uchar*) (edgeImage.step + row * edgeImage.step);

Definition of uchar:

typedef unsigned char uchar;

Definition of step function:

struct CV_EXPORTS MStep
    {
        MStep();
        MStep(size_t s);
        const size_t& operator[](int i) const;
        size_t& operator[](int i);
        operator size_t() const;
        MStep& operator = (size_t s);

        size_t* p;
        size_t buf[2];
    protected:
        MStep& operator = (const MStep&);
    };

    MStep step;

Definition of size_t: typedef _W64 unsigned int size_t; edgeImage is a MAT type image.

Initially this code was in IplImage format. I converted image from IplImage to Mat and widthstep function to step function (equivalents).

What is the purpose of this code ? When I'm printing *ptr, the compilation props up an error. I once transformed it to this:

int temp= (edgeImage.step + row * edgeImage.step);
const uchar* ptr = (const uchar*) (&temp);

and the error went away. (I think this shows a different value than the initial case and I cant verify it because - the code is too long(StrokeWidthTransform) and it is stuck at a further step in the compilation.)

2015-05-29 03:17:01 -0600 asked a question How to convert CV_IMAGE_ELEM from IplImage* to Mat ?

One of the lines of the code that i'm editing from IplImage* to Mat is

CV_IMAGE_ELEM(output, float, pit->y, pit->x) = CV_IMAGE_ELEM(SWTImage, float, pit->y, pit->x);

Please tell me how to convert it into Mat format for C++.