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.

Histogram Issue

Other Parts Discussed in Thread: TMS320DM6437


I am working with a TMS320DM6437 EVM,

My application gets video from a I2C camera, processes it and displays it in a LCD monitor. I have no problems getting video and displaying it
( configuring VPFE, VPFE, Venc, etc)..   I'm trying to incoporate histogram module.
I followed application samples included in  dvsdk_1_01_00_15\psp_1_00_02_00\  which have a video integration sample ( using histogram, h3A, resizer, previewer, etc). along with some application source files (psp_vpss_integrated.c,  psp_bios_hist_st_sample.c) that have encapsulated functions to interact with histogram module and what they do is to obtain a histogram from an image taken from a mt9001 camera module,  and then dumps the statistics into a file.

According to these files and documentation about histogram driver, There are basically 4 steps to integrate histogram module:

  1. Initialize edma3 driver
  2. Create a histogram instance:  histHandle = GIO_create(histDeviceName, IOM_INPUT, NULL, hEdma, NULL)
  3. Configure it:         histConfigIOMReturnCode = GIO_control(histHandle,  PSP_HIST_IOCTL_SET_PARAMS, &histParams)
  4. Make a 1st Enqueu to activate histogram:          histFirstEnqueueIOMReturnCode = GIO_submit(histHandle, PSP_VPSS_QUEUE, histEnBuffer,  &histFirstEnqueueSize, NULL);
  5. Make a 2nd Enqueu:         histEnqueueIOMReturnCode = GIO_submit(histHandle, PSP_VPSS_QUEUE, histEnBuffer, &histEnqueueSize, NULL);
  6. Make a dequeue to get histogram from driver: histDequeueIOMReturnCode = GIO_submit(histHandle, PSP_VPSS_DEQUEUE, histDeBuffer, &histDequeueSize, NULL);

Of course, Specific details about in&out buffers, configuration parameters, etc are to be considered.

From all these very general steps, I get an error when attempting to DEQUEUE histogram from driver, GIO_submit always returns a -2 value instead of a 0 ( succesful).
All previous steps work perfectly and have no problems with it... the only consideration I'm aware of is that steps 4 to 6 should be performed AFTER getting image from camera device (using FVID_exchange( ) with VPFE instance)  , which is considered.

Has anybody had any similar problem obtaining histogram ?? (regardless of the camera device used )

What could be a very probable cause for my dequeuing error ?? I've checked my code several times, compared it with the samples mentioned above, and can't find any bug.

Need a little guidance here, any comments would be really helpful.

Thank you !!!

 

 

 

 

 

  • I'll ask the PSP team to respond...

  • Hi Rafael,

     

    could you please tell me how to display it on a LCD screen? I am a student trying to set this up in the labs. I can use a regular composite cable to display it on a CRT monitor but no luck with LCD screens. I used a composite to vga adapter but it doesn't work, my LCD screen will not recognize the input. Do I need to change something? resolution? Thanks!

  • Hello,

    my guess is that you are using the VPBE module to display your video on a CRT (using a regular composite cable as you mentioned).

    I configured VPBE to work in Progressive mode (NOT interlaced),  and display in FVID_YCrCb422_INTERLEAVED format.

    I custom made a cable from composite video to VGA:
    in one end I have a composite video input (R,G,B) the other end of the cable I cut it  out , then took a vga monitor cable and cut out on tip too.
    I wired the RGB from the composite video cable directly to the RGB signals from the LCD monitor (with their respective grounds).
    at the end I had a cable that had composite video input and VGA output. 

    I see the images in green tones on the LCD monitor (needs to be better configured, playing with the VPBE output formats).

    --->  how did you manage to configure the output in RGB Mode ??

    This is the structure I use to configure VPBE:

    /**< Video Window Parameters */

    #define VID_PARAMS_VID0_DEFAULT {        \
     FVID_FIELD_MODE,    /* ffmodev "Progressive"*/  \
     FVID_BPP_BITS16,    /* bitsPerPixel   */ \
     FVID_YCbCr422_INTERLEAVED,  /* colorFormat    */ \
     IMAGE_WIDTH,     /* pitch (def 320)  */ \
     DISP_WIN_LEFT_MARGIN,   /* leftMargin (200)  */ \
     DISP_WIN_TOP_MARGIN,   /* topMargin (120)  */ \
     IMAGE_WIDTH,     /* width (def 320)  */ \
     (IMAGE_HEIGHT*2),    /* height (def 240)  */ \
     0,        /* segId    */ \
     PSP_VPBE_ZOOM_2X,    /* hScaling    */ \
     PSP_VPBE_ZOOM_2X,    /* vScaling    */ \
     PSP_VPBE_EXP_IDENTITY,   /* hExpansion   */ \
     PSP_VPBE_EXP_IDENTITY,   /* vExpansion   */ \
     NULL       /* appCallback   */ \
    }

    does this help ?

  • Hi: I have the similar problem with you,but I use the H3A (DM6437). How do you solve this problem?

  •  

     I dont know if you refer to the Histogram , if you do I used instead the functions included in IMGLIB library

    that also have an 8 bit histogram.. and are much easier to use and test.

    As of display, I used the VPBE and VENC modules and configured it to give a YUV output, as indicated in previous post.

     

     

  • Hi Rafael, I also used TMS320DM6437 , I also followed application samples included in dvsdk_1_01_00_15\psp_1_00_02_00\ video integration sample ( using histogram, h3A, resizer, previewer, etc). But I want to use the H3A module (psp_vpss_integrated.c,psp_h3a_application.c) to enhance the images , now I meet the same problem whit you. When I follow all these very general steps with you, I also get an error when attempting to DEQUEUE H3A from driver, GIO_submit always returns a -2 value instead of a 0 ( succesful). I want to know how do you slove this problem?Can you tell me? Thank you!
  •  Hi,

    I see what you mean now,
    the bad news is that I didn't solve the problem, I posted my problem but didn't receive any reply from TI people at that time ( as you can see after my 1st post in this same message loop),
    so what I did is to look for alternative solutions, such as the histogram function included in IMGLIB library, which worked good enough for me.

    Try opening a new Post describing your problem, hopefully you'll have better luck!

    Regards!