This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

IMGLIB: Dilate image using img_dilate_lib.

Hi,

 I am executing IMGLIB examples from the following path ...\libraries\ti\C6400\imglib.

 I executed img_dilate_bin.pjt available at ...\ libraries\ti\C6400\imglib\examples\img_dilate_bin,in CCS v3.3 which is successful. But, if I give the input as a binary raw image  of dimensions 1280*800 and dilate the same using the function IMG_dilate_bin_c(in_data, out_data_c, mask,COLS); the output is not correct

  I am opening the image(1280*800) using FILE pointer and processing as follows;

#define N (1024000)
#define COLS (N/8)

unsigned char in_data[N];

unsigned char out_data_c[COLS];

const char mask[9] =
{
-1, 1, -1,
1, 1, 1,
-1, 1, -1
};

int main()

{

   FILE *fprd,*fpwrt;

   fprd=fopen("Input.raw","rb");
   fread(in_data,sizeof(unsigned char),sizeof(in_data),fprd);

   IMG_dilate_bin_c(in_data, out_data_c, mask,COLS);


  fpwrt=fopen("Output.raw","wb");
  fwrite(out_data_c,sizeof(unsigned char),sizeof(out_data_c),fpwrt);


   printf("\n Output Generated\n");
 

}

Size of in_data is 1280*800 but out_data_c is ((1280*800)/8) =COLS in the function.

Thus the output will be of size COLS, so the complete image is not obtained.

How is this functionality working?What are the changes required in the function to get the output image of size 1280*800?

Kindly refer the attachment for input and output images(in .jpg as .raw is not the supported attachment ).



Input image



Output Image.

 Thanks and Regards,

Sowmya.JV

  • Sowmya,

    Please kindly mention which version of IMGLIB are you using and board details.

  • Hi Pubesh,

    Thanks for your reply.

    The version of C64xIMGLIB  DSP Signal Processing Library I am using is Version 1.04b.

    I executed the program in CCS v3.3 in Simulator mode with C64x+ CPU Cycle Accurate Simulator, Little Endian and the Processor type is TMS320C64X+.

    Thanks and Regards,

    Sowmya

  • Hi Sowmya,

    The IMG_dilate_bin API expects input image to be in packed binary format so you will need to format the binary image read from the file to packed binary form as explain in the example project in the IMGLIB library to be able to apply image dilation on the image. similarly if you want to store the processed image to a file, you will need to convert the packed binary to raw binary format and store the output image.

    Please give this a try and let us know if you are still having issues.

    Regards,

    Rahul