Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Double* from cv::Mat.ptr

I am using Opencv in Visual Studio 2012 with C++ in a Console Application.

fastx and fasty are both pointers to image matrices, a cv::Mat. When i hit i=1194 fastJy crashes when assigning it a value. Using break points, it seems that fasty has a value of '<unable to="" read="" memory="">' when the variable is inspected.

[code] void IterationStage(cv::Mat Jx, cv::Mat Jy) { double* fastx; double* fasty; for(int i=0; i<_count;i++) { fastJx = Jx.ptr<double>(0) + Jx.stepi; fastJy = Jy.ptr<double>(0) + Jy.stepi;

fastJx[0] = 255;
fastJx[1] = 255;
}

} [/code]

Making this change fixes fastJy.

[code] void IterationStage(cv::Mat Jx, cv::Mat Jy) { double* fastx; double* fasty; for(int i=0; i<_count;i++) { fastJx = Jx.ptr<double>(0) + Jx.stepi; fastJy = Jx.ptr<double>(0) + Jy.stepi; //CHANGED HERE.

fastJx[0] = 255;
fastJx[1] = 255;
}

} [/code]

This is odd as i am still using the Jy.step with the Jx matrix. Both matrices are initialized with the same constructor, just before the function is calledas shown below.

[code] cv::Mat Jx = cv::Mat::zeros(__paw.nPix(), __shape.nModes()+4, CV_64FC1); cv::Mat Jy = cv::Mat::zeros(__paw.nPix(), __shape.nModes()+4, CV_64FC1); IterationStage(cv::Mat Jx, cv::Mat Jy) [/code]

Anyway, the error message is this.

"Unhandled exception at 0x003A5777 in OpencvShapeTest.exe: 0xC0000005: Access violation writing location 0x024290A0."

Double* from cv::Mat.ptr

I am using Opencv in Visual Studio 2012 with C++ in a Console Application.

fastx and fasty are both pointers to image matrices, a cv::Mat. When i hit i=1194 fastJy crashes when assigning it a value. Using break points, it seems that fasty has a value of '<unable to="" read="" memory="">' 'Unable to read memory' when the variable is inspected.

[code] void IterationStage(cv::Mat Jx, cv::Mat Jy) { double* fastx; double* fasty; for(int i=0; i<_count;i++) { fastJx = Jx.ptr<double>(0) + Jx.stepi; fastJy = Jy.ptr<double>(0) + Jy.stepi;

fastJx[0] = 255;
fastJx[1] = 255;
}

} [/code]

Making this change fixes fastJy.

[code] void IterationStage(cv::Mat Jx, cv::Mat Jy) { double* fastx; double* fasty; for(int i=0; i<_count;i++) { fastJx = Jx.ptr<double>(0) + Jx.stepi; fastJy = Jx.ptr<double>(0) + Jy.stepi; //CHANGED HERE.

fastJx[0] = 255;
fastJx[1] = 255;
}

} [/code]

This is odd as i am still using the Jy.step with the Jx matrix. Both matrices are initialized with the same constructor, just before the function is calledas shown below.

[code] cv::Mat Jx = cv::Mat::zeros(__paw.nPix(), __shape.nModes()+4, CV_64FC1); cv::Mat Jy = cv::Mat::zeros(__paw.nPix(), __shape.nModes()+4, CV_64FC1); IterationStage(cv::Mat Jx, cv::Mat Jy) [/code]

Anyway, the error message is this.

"Unhandled exception at 0x003A5777 in OpencvShapeTest.exe: 0xC0000005: Access violation writing location 0x024290A0."

click to hide/show revision 3
No.3 Revision

Double* from cv::Mat.ptr

I am using Opencv in Visual Studio 2012 with C++ in a Console Application.

fastx and fasty are both pointers to image matrices, a cv::Mat. When i hit i=1194 fastJy crashes when assigning it a value. Using break points, it seems that fasty has a value of 'Unable to read memory' when the variable is inspected.

void IterationStage(cv::Mat Jx, cv::Mat Jy)
{
    double* fastx;
    double* fasty;
    for(int i=0; i<_count;i++)
    {
        fastJx = Jx.ptr<double>(0) + Jx.step*i;
    fastJy = Jy.ptr<double>(0) + Jy.step*i;

    fastJx[0] = 255;
    fastJx[1] = 255;
    }
}
[/code]

Making this change fixes fastJy.

[code]
void IterationStage(cv::Mat Jx, cv::Mat Jy)
{
    double* fastx;
    double* fasty;
    for(int i=0; i<_count;i++)
    {
        fastJx = Jx.ptr<double>(0) + Jx.stepi;
Jx.step*i;
    fastJy = Jy.ptr<double>(0) Jx.ptr<double>(0) + Jy.stepi;

Jy.step*i;  //CHANGED HERE.

    fastJx[0] = 255;
 fastJx[1] = 255;
    }
}

} [/code]

Making this change fixes fastJy.

[code] void IterationStage(cv::Mat Jx, cv::Mat Jy) { double* fastx; double* fasty; for(int i=0; i<_count;i++) { fastJx = Jx.ptr<double>(0) + Jx.stepi; fastJy = Jx.ptr<double>(0) + Jy.stepi; //CHANGED HERE.

fastJx[0] = 255;
fastJx[1] = 255;
}

} [/code]

This is odd as i am still using the Jy.step with the Jx matrix. Both matrices are initialized with the same constructor, just before the function is calledas shown below.

[code]

cv::Mat Jx = cv::Mat::zeros(__paw.nPix(), __shape.nModes()+4, CV_64FC1);
cv::Mat Jy = cv::Mat::zeros(__paw.nPix(), __shape.nModes()+4, CV_64FC1);
IterationStage(cv::Mat Jx, cv::Mat Jy)
[/code]

Anyway, the error message is this.

"Unhandled exception at 0x003A5777 in OpencvShapeTest.exe: 0xC0000005: Access violation writing location 0x024290A0."

Double* from cv::Mat.ptr

I am using Opencv in Visual Studio 2012 with C++ in a Console Application.

fastx fastJx and fasty fastJy are both pointers to image matrices, a cv::Mat. When i hit i=1194 fastJy crashes when assigning it a value. Using break points, it seems that fasty fastJy has a value of 'Unable to read memory' when the variable is inspected.

void IterationStage(cv::Mat Jx, cv::Mat Jy) { double* fastx; double* fasty; for(int i=0; i<_count;i++) { fastJx = Jx.ptr<double>(0) + Jx.step*i; Jx.stepi; fastJy = Jy.ptr<double>(0) + Jy.step*i; Jy.stepi;

fastJx[0] = 255;
 fastJx[1] = 255;
 }
}
[/code]

}

Making this change fixes fastJy. [code] fastJy.

void IterationStage(cv::Mat Jx, cv::Mat Jy) { double* fastx; double* fasty; for(int i=0; i<_count;i++) { fastJx = Jx.ptr<double>(0) + Jx.step*i; Jx.stepi; fastJy = Jx.ptr<double>(0) + Jy.step*i; Jy.stepi; //CHANGED HERE. HERE.

fastJx[0] = 255;
 fastJx[1] = 255;
    }
}

}

This is odd as i am still using the Jy.step with the Jx matrix. Both matrices are initialized with the same constructor, just before the function is calledas shown below.

cv::Mat Jx = cv::Mat::zeros(__paw.nPix(), __shape.nModes()+4, CV_64FC1); cv::Mat Jy = cv::Mat::zeros(__paw.nPix(), __shape.nModes()+4, CV_64FC1); IterationStage(cv::Mat Jx, cv::Mat Jy)

Jy)

Anyway, the error message is this.

"Unhandled exception at 0x003A5777 in OpencvShapeTest.exe: 0xC0000005: Access violation writing location 0x024290A0."

Double* from cv::Mat.ptr

I am using Opencv in Visual Studio 2012 with C++ in a Console Application.

fastJx and fastJy are both pointers to image matrices, a cv::Mat. When i hit i=1194 fastJy crashes when assigning it a value. Using break points, it seems that fastJy has a value of 'Unable to read memory' when the variable is inspected.

void IterationStage(cv::Mat Jx, cv::Mat Jy)
Jy) {
    double* fastx;
    double* fasty;
    for(int i=0; i<_count;i++)
    {
        fastJx = Jx.ptr<double>(0) + Jx.stepi;
    fastJy = Jy.ptr<double>(0) Jx.step*i;     fastJy = Jy.ptr<double>(0)
+ Jy.stepi;

Jy.step*i;
            fastJx[0] = 255;    fastJx[1] = 255;
fastJx[1] = 255;
    } }

}

Making this change fixes fastJy.

void IterationStage(cv::Mat Jx, cv::Mat Jy)
{
    double* fastx;
    double* fasty;
    for(int i=0; i<_count;i++)
    {
        fastJx = Jx.ptr<double>(0) + Jx.stepi;
Jx.step*i;
    fastJy = Jx.ptr<double>(0) + Jy.stepi; Jy.step*i;  //CHANGED HERE.

HERE.

    fastJx[0] = 255;
 fastJx[1] = 255;
    }
}

}

This is odd as i am still using the Jy.step with the Jx matrix. Both matrices are initialized with the same constructor, just before the function is calledas shown below.

cv::Mat Jx = cv::Mat::zeros(__paw.nPix(), __shape.nModes()+4, CV_64FC1);
cv::Mat Jy = cv::Mat::zeros(__paw.nPix(), __shape.nModes()+4, CV_64FC1);
IterationStage(cv::Mat Jx, cv::Mat Jy)

Jy)

Anyway, the error message is this.

"Unhandled exception at 0x003A5777 in OpencvShapeTest.exe: 0xC0000005: Access violation writing location 0x024290A0."

Double* from cv::Mat.ptr

I am using Opencv in Visual Studio 2012 with C++ in a Console Application.

fastJx and fastJy are both pointers to image matrices, a cv::Mat. When i hit reach iteration i=1194 fastJy crashes when assigning it a value. Using break points, it seems that fastJy has a value of 'Unable to read memory' when the variable is inspected.

Both Jx and Jy, the source cv::Mat for the pointers are the same size. It is only on this iteration that there is a problem.

void IterationStage(cv::Mat Jx, cv::Mat Jy) {
    double* fastx;
    double* fasty;
    for(int i=0; i<_count;i++)
    {
        fastJx = Jx.ptr<double>(0) + Jx.step*i;     fastJy = Jy.ptr<double>(0)

        fastJy = Jy.ptr<double>(0) + Jy.step*i;
         fastJx[0] = 255;     fastJx[1] = 255;
    }  }

Making this change fixes fastJy.

void IterationStage(cv::Mat Jx, cv::Mat Jy)
{
    double* fastx;
    double* fasty;
    for(int i=0; i<_count;i++)
    {
        fastJx = Jx.ptr<double>(0) + Jx.step*i;
     fastJy = Jx.ptr<double>(0) + Jy.step*i;  //CHANGED HERE.

     fastJx[0] = 255;
     fastJx[1] = 255;
    }
}

This is odd as i am still using the Jy.step with the Jx matrix. Both matrices are initialized with the same constructor, just before the function is calledas shown below.

cv::Mat Jx = cv::Mat::zeros(__paw.nPix(), __shape.nModes()+4, CV_64FC1);
cv::Mat Jy = cv::Mat::zeros(__paw.nPix(), __shape.nModes()+4, CV_64FC1);
IterationStage(cv::Mat Jx, cv::Mat Jy)

Anyway, the error message is this.

"Unhandled exception at 0x003A5777 in OpencvShapeTest.exe: 0xC0000005: Access violation writing location 0x024290A0."

click to hide/show revision 7
retagged

updated 2014-01-25 06:33:54 -0600

berak gravatar image

Double* from cv::Mat.ptr

I am using Opencv in Visual Studio 2012 with C++ in a Console Application.

fastJx and fastJy are both pointers to image matrices, a cv::Mat. When i reach iteration i=1194 fastJy crashes when assigning it a value. Using break points, it seems that fastJy has a value of 'Unable to read memory' when the variable is inspected.

Both Jx and Jy, the source cv::Mat for the pointers are the same size. It is only on this iteration that there is a problem.

void IterationStage(cv::Mat Jx, cv::Mat Jy) {
    double* fastx;
    double* fasty;
    for(int i=0; i<_count;i++)
    {
        fastJx = Jx.ptr<double>(0) + Jx.step*i;     
        fastJy = Jy.ptr<double>(0) + Jy.step*i;
        fastJx[0] = 255;    
        fastJx[1] = 255;
    } 
}

Making this change fixes fastJy.

void IterationStage(cv::Mat Jx, cv::Mat Jy)
{
    double* fastx;
    double* fasty;
    for(int i=0; i<_count;i++)
    {
        fastJx = Jx.ptr<double>(0) + Jx.step*i;
        fastJy = Jx.ptr<double>(0) + Jy.step*i;  //CHANGED HERE.

        fastJx[0] = 255;
        fastJx[1] = 255;
    }
}

This is odd as i am still using the Jy.step with the Jx matrix. Both matrices are initialized with the same constructor, just before the function is calledas shown below.

cv::Mat Jx = cv::Mat::zeros(__paw.nPix(), __shape.nModes()+4, CV_64FC1);
cv::Mat Jy = cv::Mat::zeros(__paw.nPix(), __shape.nModes()+4, CV_64FC1);
IterationStage(cv::Mat Jx, cv::Mat Jy)

Anyway, the error message is this.

"Unhandled exception at 0x003A5777 in OpencvShapeTest.exe: 0xC0000005: Access violation writing location 0x024290A0."

Double* from cv::Mat.ptr

I am using Opencv in Visual Studio 2012 with C++ in a Console Application.

fastJx and fastJy are both pointers to image matrices, a cv::Mat. When i reach iteration i=1194 fastJy crashes when assigning it a value. Using break points, it seems that fastJy has a value of 'Unable to read memory' when the variable is inspected.

Both Jx and Jy, the source cv::Mat for the pointers are the same size. It is only on this iteration that there is a problem.

void IterationStage(cv::Mat Jx, cv::Mat Jy) {
    double* fastx;
fastJx;
    double* fasty;
fastJy;
    for(int i=0; i<_count;i++)
    {
        fastJx = Jx.ptr<double>(0) + Jx.step*i;     
        fastJy = Jy.ptr<double>(0) + Jy.step*i;
        fastJx[0] = 255;    
        fastJx[1] = 255;
    } 
}

Making this change fixes fastJy.

void IterationStage(cv::Mat Jx, cv::Mat Jy)
{
    double* fastx;
fastJx;
    double* fasty;
fastJy;
    for(int i=0; i<_count;i++)
    {
        fastJx = Jx.ptr<double>(0) + Jx.step*i;
        fastJy = Jx.ptr<double>(0) + Jy.step*i;  //CHANGED HERE.

        fastJx[0] = 255;
        fastJx[1] = 255;
    }
}

This is odd as i am still using the Jy.step with the Jx matrix. Both matrices are initialized with the same constructor, just before the function is calledas shown below.

cv::Mat Jx = cv::Mat::zeros(__paw.nPix(), __shape.nModes()+4, CV_64FC1);
cv::Mat Jy = cv::Mat::zeros(__paw.nPix(), __shape.nModes()+4, CV_64FC1);
IterationStage(cv::Mat Jx, cv::Mat Jy)
IterationStage(Jx, Jy);

Anyway, the error message is this.

"Unhandled exception at 0x003A5777 in OpencvShapeTest.exe: 0xC0000005: Access violation writing location 0x024290A0."