Hello,
I use a code that I have develop on my computer to interpolate an image. It works properly on my computer but on the shield the interpolation always send me 0.
Here is the code:
texture<unsigned char, 2,cudaReadModeElementType> Image_Gray;
__global__ void ExtractMarker56p( u_int8_t *ptTemplateMarker, TransformationM *ptMatrix)
{
__shared__ float localTransformation[9];
if(threadIdx.x <9 && threadIdx.y == 0)
{
localTransformation[threadIdx.x] = ptMatrix[blockIdx.x].Homography[threadIdx.x];
}
syncthreads();
for(int i=threadIdx.x;i<_MARKER_MAX_SIZE;i+=blockDim.x)
{
for(int j=threadIdx.y;j<_MARKER_MAX_SIZE;j+=blockDim.y)
{
float x00 = (float)i;
float y00 = (float)j;
float fcoef = localTransformation[6]*x00+localTransformation[7]*y00+localTransformation[8];
float x0 = (localTransformation[0]*x00 + localTransformation[1]*y00 +localTransformation[2])/fcoef;
float y0 = (localTransformation[3]*x00 + localTransformation[4]*y00 +localTransformation[5])/fcoef;
u_int8_t u8_Val = tex2D(Image_Gray,(x0),(y0));
ptTemplateMarker[blockIdx.x*_MARKER_MAX_SIZE*_MARKER_MAX_SIZE + (i + j*_MARKER_MAX_SIZE) ] = u8_Val;
}
}
}
......
cudaChannelFormatDesc desc = cudaCreateChannelDesc<unsigned char>();
Image_Gray.filterMode = cudaFilterModePoint;
Image_Gray.normalized = 0;
//Image_Gray.addressMode[0] = cudaAddressModeWrap;
//Image_Gray.addressMode[1] = cudaAddressModeWrap;
checkCudaErrors(cudaBindTexture2D(0,&Image_Gray,u8_GrayImage_Device, &desc, icols , irows, icols));
Why is there a difference between my computer and the jetson?