fixed warnings "double not supported"
This commit is contained in:
parent
7ab9c4ccee
commit
e311613fc8
@ -76,7 +76,7 @@ namespace cv { namespace gpu { namespace device
|
|||||||
static __device__ __forceinline__ void calc(int x, int y, float x_data, float y_data, float* dst, size_t dst_step, float scale)
|
static __device__ __forceinline__ void calc(int x, int y, float x_data, float y_data, float* dst, size_t dst_step, float scale)
|
||||||
{
|
{
|
||||||
float angle = ::atan2f(y_data, x_data);
|
float angle = ::atan2f(y_data, x_data);
|
||||||
angle += (angle < 0) * 2.0 * CV_PI;
|
angle += (angle < 0) * 2.0f * CV_PI_F;
|
||||||
dst[y * dst_step + x] = scale * angle;
|
dst[y * dst_step + x] = scale * angle;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -140,7 +140,7 @@ namespace cv { namespace gpu { namespace device
|
|||||||
grid.x = divUp(x.cols, threads.x);
|
grid.x = divUp(x.cols, threads.x);
|
||||||
grid.y = divUp(x.rows, threads.y);
|
grid.y = divUp(x.rows, threads.y);
|
||||||
|
|
||||||
const float scale = angleInDegrees ? (float)(180.0f / CV_PI) : 1.f;
|
const float scale = angleInDegrees ? (180.0f / CV_PI_F) : 1.f;
|
||||||
|
|
||||||
cartToPolar<Mag, Angle><<<grid, threads, 0, stream>>>(
|
cartToPolar<Mag, Angle><<<grid, threads, 0, stream>>>(
|
||||||
x.data, x.step/x.elemSize(), y.data, y.step/y.elemSize(),
|
x.data, x.step/x.elemSize(), y.data, y.step/y.elemSize(),
|
||||||
@ -190,7 +190,7 @@ namespace cv { namespace gpu { namespace device
|
|||||||
grid.x = divUp(mag.cols, threads.x);
|
grid.x = divUp(mag.cols, threads.x);
|
||||||
grid.y = divUp(mag.rows, threads.y);
|
grid.y = divUp(mag.rows, threads.y);
|
||||||
|
|
||||||
const float scale = angleInDegrees ? (float)(CV_PI / 180.0f) : 1.0f;
|
const float scale = angleInDegrees ? (CV_PI_F / 180.0f) : 1.0f;
|
||||||
|
|
||||||
polarToCart<Mag><<<grid, threads, 0, stream>>>(mag.data, mag.step/mag.elemSize(),
|
polarToCart<Mag><<<grid, threads, 0, stream>>>(mag.data, mag.step/mag.elemSize(),
|
||||||
angle.data, angle.step/angle.elemSize(), scale, x.data, x.step/x.elemSize(), y.data, y.step/y.elemSize(), mag.cols, mag.rows);
|
angle.data, angle.step/angle.elemSize(), scale, x.data, x.step/x.elemSize(), y.data, y.step/y.elemSize(), mag.cols, mag.rows);
|
||||||
@ -214,4 +214,4 @@ namespace cv { namespace gpu { namespace device
|
|||||||
} // namespace mathfunc
|
} // namespace mathfunc
|
||||||
}}} // namespace cv { namespace gpu { namespace device
|
}}} // namespace cv { namespace gpu { namespace device
|
||||||
|
|
||||||
#endif /* CUDA_DISABLER */
|
#endif /* CUDA_DISABLER */
|
||||||
|
@ -164,40 +164,40 @@ namespace cv { namespace gpu { namespace device
|
|||||||
|
|
||||||
r = ::fmin(r, 2.5f);
|
r = ::fmin(r, 2.5f);
|
||||||
|
|
||||||
v[1].x = arrow_x + r * ::cosf(theta - CV_PI / 2.0f);
|
v[1].x = arrow_x + r * ::cosf(theta - CV_PI_F / 2.0f);
|
||||||
v[1].y = arrow_y + r * ::sinf(theta - CV_PI / 2.0f);
|
v[1].y = arrow_y + r * ::sinf(theta - CV_PI_F / 2.0f);
|
||||||
|
|
||||||
v[4].x = arrow_x + r * ::cosf(theta + CV_PI / 2.0f);
|
v[4].x = arrow_x + r * ::cosf(theta + CV_PI_F / 2.0f);
|
||||||
v[4].y = arrow_y + r * ::sinf(theta + CV_PI / 2.0f);
|
v[4].y = arrow_y + r * ::sinf(theta + CV_PI_F / 2.0f);
|
||||||
|
|
||||||
int indx = (y * u_avg.cols + x) * NUM_VERTS_PER_ARROW * 3;
|
int indx = (y * u_avg.cols + x) * NUM_VERTS_PER_ARROW * 3;
|
||||||
|
|
||||||
color_data[indx] = (theta - CV_PI) / CV_PI * 180.0f;
|
color_data[indx] = (theta - CV_PI_F) / CV_PI_F * 180.0f;
|
||||||
vertex_data[indx++] = v[0].x * xscale;
|
vertex_data[indx++] = v[0].x * xscale;
|
||||||
vertex_data[indx++] = v[0].y * yscale;
|
vertex_data[indx++] = v[0].y * yscale;
|
||||||
vertex_data[indx++] = v[0].z;
|
vertex_data[indx++] = v[0].z;
|
||||||
|
|
||||||
color_data[indx] = (theta - CV_PI) / CV_PI * 180.0f;
|
color_data[indx] = (theta - CV_PI_F) / CV_PI_F * 180.0f;
|
||||||
vertex_data[indx++] = v[1].x * xscale;
|
vertex_data[indx++] = v[1].x * xscale;
|
||||||
vertex_data[indx++] = v[1].y * yscale;
|
vertex_data[indx++] = v[1].y * yscale;
|
||||||
vertex_data[indx++] = v[1].z;
|
vertex_data[indx++] = v[1].z;
|
||||||
|
|
||||||
color_data[indx] = (theta - CV_PI) / CV_PI * 180.0f;
|
color_data[indx] = (theta - CV_PI_F) / CV_PI_F * 180.0f;
|
||||||
vertex_data[indx++] = v[2].x * xscale;
|
vertex_data[indx++] = v[2].x * xscale;
|
||||||
vertex_data[indx++] = v[2].y * yscale;
|
vertex_data[indx++] = v[2].y * yscale;
|
||||||
vertex_data[indx++] = v[2].z;
|
vertex_data[indx++] = v[2].z;
|
||||||
|
|
||||||
color_data[indx] = (theta - CV_PI) / CV_PI * 180.0f;
|
color_data[indx] = (theta - CV_PI_F) / CV_PI_F * 180.0f;
|
||||||
vertex_data[indx++] = v[3].x * xscale;
|
vertex_data[indx++] = v[3].x * xscale;
|
||||||
vertex_data[indx++] = v[3].y * yscale;
|
vertex_data[indx++] = v[3].y * yscale;
|
||||||
vertex_data[indx++] = v[3].z;
|
vertex_data[indx++] = v[3].z;
|
||||||
|
|
||||||
color_data[indx] = (theta - CV_PI) / CV_PI * 180.0f;
|
color_data[indx] = (theta - CV_PI_F) / CV_PI_F * 180.0f;
|
||||||
vertex_data[indx++] = v[4].x * xscale;
|
vertex_data[indx++] = v[4].x * xscale;
|
||||||
vertex_data[indx++] = v[4].y * yscale;
|
vertex_data[indx++] = v[4].y * yscale;
|
||||||
vertex_data[indx++] = v[4].z;
|
vertex_data[indx++] = v[4].z;
|
||||||
|
|
||||||
color_data[indx] = (theta - CV_PI) / CV_PI * 180.0f;
|
color_data[indx] = (theta - CV_PI_F) / CV_PI_F * 180.0f;
|
||||||
vertex_data[indx++] = v[5].x * xscale;
|
vertex_data[indx++] = v[5].x * xscale;
|
||||||
vertex_data[indx++] = v[5].y * yscale;
|
vertex_data[indx++] = v[5].y * yscale;
|
||||||
vertex_data[indx++] = v[5].z;
|
vertex_data[indx++] = v[5].z;
|
||||||
@ -217,4 +217,4 @@ namespace cv { namespace gpu { namespace device
|
|||||||
}
|
}
|
||||||
}}}
|
}}}
|
||||||
|
|
||||||
#endif /* CUDA_DISABLER */
|
#endif /* CUDA_DISABLER */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user