You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Thursday, June 2nd 2011, 11:42pm

what is this error

Hello every one

I am using Qt creator to design GUI for VC++ with opencv library.

when I use this function in for loop from 0 to 4,in each iteration I call it 2 times , and it runs correct when counter=0 and =1(so call the function 4 times), after that the run stop and I must close it.

The function is:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
IplImage* inverse_warp_rotate(IplImage* before, CvBox2D box) {
   float pi = 3.141592653;
   float angle = box.angle * pi/180;


    IplImage* after = cvCreateImage(cvSize(box.size.height,box.size.width),before->depth, before->nChannels);


    double aftercenterx = ((double)after->width)/2;
    double aftercentery = ((double)after->height)/2;

    for(int a = 0; a < after->width;a++)
    {
        for(int b = 0; b < after->height;b++)
                {
            // coordinates in downsampled image corresponding to window center in original image
            double dscoordx = box.center.x; //FIXME: don't know what this should be
            double dscoordy = box.center.y;
            double translatedx = a - aftercenterx;
            double translatedy = b - aftercentery;

            double rotatedx = translatedx * cos(angle) + translatedy * (sin(angle));
            double rotatedy = translatedx * (-sin(angle)) + translatedy * cos(angle);

            double transbackx = rotatedx + dscoordx;
            double transbacky = rotatedy + dscoordy;             // P, Q, R, S coordinates where P, Q, R, S are the nearest neighboring pixels

            //std::vectorNx;
            //std::vectorNy;

            QVector Nx(4);
            QVector Ny(4);
}

            int Px = floor(transbackx);
            Nx.push_back(Px);
            int Py = floor(transbacky);
            Ny.push_back(Py);
                        int Qx = floor(transbackx)+1;
            Nx.push_back(Qx);
            int Qy = floor(transbacky);
            Ny.push_back(Qy);
                        int Rx = floor(transbackx);
            Nx.push_back(Rx);
                        int Ry = floor(transbacky)+1;
            Ny.push_back(Ry);
            int Sx = floor(transbackx)+1;
            Nx.push_back(Sx);
                        int Sy = floor(transbacky)+1;
            Ny.push_back(Sy);

           // qDebug("the size of Nx.size()=%d",Nx.size());
           // qDebug("the size of Ny.size()=%d",Ny.size());

                for(unsigned(o) = 0; o < 4; o++)
                {
              if(Nx[o] < 0)
                          {
                Nx[o] = 0;
                          }
                        else if(Nx[o] >= before->width)
                        {
                Nx[o] = before->width-1;
                        }
              if(Ny[o] < 0)
                          {
                Ny[o] = 0;
                          }
              else if(Ny[o] >= before->height)
                          {
                Ny[o] = before->height-1;
                          }

                }
            double alpha = transbackx - Nx[0];
            double beta = transbacky - Ny[0];
            CvScalar P = cvGet2D(before, Ny[0], Nx[0]);
            CvScalar Q = cvGet2D(before, Ny[1], Nx[1]);
            CvScalar R = cvGet2D(before, Ny[2], Nx[2]);
            CvScalar S = cvGet2D(before, Ny[3], Nx[3]);

                        CvScalar MOPSpixel = cvGet2D(before, Ny[3], Nx[3]);
            MOPSpixel.val[0] = (1-alpha)*(1-beta)*P.val[0] + alpha*(1-beta)*Q.val[0] + (1-alpha)*beta*R.val[0] + alpha*beta*S.val[0];
            cvSet2D(after, b, a, MOPSpixel);
                }
        }
         // apply threshold: those pixels that have intensities > 0 will have them set to 1.
for(int a = 0; a < after->height; a++)
{
        for(int b = 0; b < after->width; b++)
                {
            CvScalar Afterpixel = cvGet2D(after, a, b);
            Afterpixel.val[0] = (Afterpixel.val[0] > 0 ? 255 : 0);
            cvSet2D(after, a, b, Afterpixel);
                }
}


    return after;
 



and when I start the debugger it has:


Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
SXS: Invalid parameter(s) passed to FindActCtxSection*()   dwFlags = 0x00000001
   ReturnedData = 0022AAFC
      ->cbSize = 0
SXS: Invalid parameter(s) passed to FindActCtxSection*()
   dwFlags = 0x00000001
   ReturnedData = 0022AAFC
      ->cbSize = 0
SXS: Invalid parameter(s) passed to FindActCtxSection*()
   dwFlags = 0x00000001
   ReturnedData = 0022AAFC
      ->cbSize = 0
SXS: Invalid parameter(s) passed to FindActCtxSection*()
   dwFlags = 0x00000001
   ReturnedData = 0022AAFC
      ->cbSize = 0


Note: I use windows7 with 4G RAM.
Any help please I am a beginner in Qt. ?(

Thanks in Advance. :)

pele1410

Trainee

  • "pele1410" is male

Posts: 126

Location: Lafayette, LA

  • Send private message

2

Friday, June 3rd 2011, 12:53pm

I don't know what FindActCtxSection is, so I googled it. This appears to be an issue with Microsoft, not Qt. Try this link, which discusses an update that causes this error:
http://social.msdn.microsoft.com/Forums/…9-81ef8edfe376/
"Without imperfection, you or I would not exist." ~Stephen Hawking