Skip to content

Commit a56d282

Browse files
committed
Merge pull request #2283 from tolysz:patch-1
2 parents a8c7a56 + a9639b2 commit a56d282

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

modules/cudalegacy/include/opencv2/cudalegacy/NCVHaarObjectDetection.hpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,11 @@ struct HaarFeature64
8484
__host__ NCVStatus setRect(Ncv32u rectX, Ncv32u rectY, Ncv32u rectWidth, Ncv32u rectHeight, Ncv32u /*clsWidth*/, Ncv32u /*clsHeight*/)
8585
{
8686
ncvAssertReturn(rectWidth <= HaarFeature64_CreateCheck_MaxRectField && rectHeight <= HaarFeature64_CreateCheck_MaxRectField, NCV_HAAR_TOO_LARGE_FEATURES);
87-
((NcvRect8u*)&(this->_ui2.x))->x = (Ncv8u)rectX;
88-
((NcvRect8u*)&(this->_ui2.x))->y = (Ncv8u)rectY;
89-
((NcvRect8u*)&(this->_ui2.x))->width = (Ncv8u)rectWidth;
90-
((NcvRect8u*)&(this->_ui2.x))->height = (Ncv8u)rectHeight;
87+
NcvRect8u* tmpRect = (NcvRect8u*)&this->_ui2.x;
88+
tmpRect->x = (Ncv8u)rectX;
89+
tmpRect->y = (Ncv8u)rectY;
90+
tmpRect->width = (Ncv8u)rectWidth;
91+
tmpRect->height = (Ncv8u)rectHeight;
9192
return NCV_SUCCESS;
9293
}
9394

@@ -99,11 +100,11 @@ struct HaarFeature64
99100

100101
__device__ __host__ void getRect(Ncv32u *rectX, Ncv32u *rectY, Ncv32u *rectWidth, Ncv32u *rectHeight)
101102
{
102-
NcvRect8u tmpRect = *(NcvRect8u*)(&this->_ui2.x);
103-
*rectX = tmpRect.x;
104-
*rectY = tmpRect.y;
105-
*rectWidth = tmpRect.width;
106-
*rectHeight = tmpRect.height;
103+
NcvRect8u* tmpRect = (NcvRect8u*)&this->_ui2.x;
104+
*rectX = tmpRect->x;
105+
*rectY = tmpRect->y;
106+
*rectWidth = tmpRect->width;
107+
*rectHeight = tmpRect->height;
107108
}
108109

109110
__device__ __host__ Ncv32f getWeight(void)

0 commit comments

Comments
 (0)