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.

How to extract the interested area from the original image(1920x1080)?

Hi,

IP camera is inder the development. One feature is to extract the interested area from the original captured one.

This feature can be used as the followings.

1. The original captured one(1920x1080) is low-bitrate encoded and sent to the client.

2. If the user will click the interested area, that area is extracted from the original captured one and this area is high-bitrate encoded and then sent to the client.

How powerful is DM368 cropping?

 

  • Seung Youl Lee,

    I want to understand more about the scenario.

    If user chooses 'interested area', you want to capture only that area, right? Do you want to do any resizing on top of that? Do you want to set cropping while capturing or on the frame which is already captured?

    Regarding h/w capabilities,

    DM36x CCDC supports cropping. You can start capturing 'cropped' images based on client's input. Cropping should not induce any delay in capturing. So, no performance degradation. I am not sure about how encode will fare with new image size(I am not the expert on this area).

  • Hi,

    The interested area is the portion of the captured original image(1920x1080). Not resizing.

    The coordinate of the original area is (0,0) and (1920,1080) and the interested area can be (500,500) and (1000,1000).

    The original image is tranferred and also the intertested area is tranfferred to the client.

    Because we must transfer both the original image and the interested image to the clients,

    we want to crop the image after capturing the original one.

     

    Is it possible for CCDC to crop(any size) the captured frame after capturing?

     

     

  • In this case, you should be able to request encode module to encode only 'requested area' [I am not a expert in encode area, encode engineers can give authentic answer]. But, CCDC can't come into picture as it can only  crop incoming video frame from sensor/decoder.

  • Hi,

    There are multiple ways of doing this:

    1. Assuming you are using oneshot capture mode, where capture is decoupled with resizer, then you can use resizer module once again in single shot mode to crop the data from 1920x1080 to 1000x1000 with startX and startY as 500,500.  This way you will have a cropped output of 1000x1000 that can be directly given to encoder. This can not work in continuous mode as the resizer would be directly connected to capture to give 1920x1080, and not be able to do the cropping separately.

    2. The other option is to use EDMA engine to do a 2D copy from 1920x1080 YUV data to another buffer which will have size of 1000x1000. You will have to set the lineoffset of copy as 1920x2 for YUV422 data and startx and startY location as 500,500. This way you can get another buffer that has 1000x1000 YUV data. This would work whether you use continuous mode or singleshot mode capture.

    3. Assuming you need the encoder to encode this 1000x1000 data, then you can use one more approach. In this case, you give the input to the encoder that is already offset by 500,500 that is (startAddr + 500*1920 + 500) for Y buffer and (uvStartAddr + 500/2*1920 + 500) for UV buffer. The constraints of buffer addresses to be multiple of 32 and the constraints of captureWidth, maxWidth, maxHeight etc. are going to be maintained. So you might not be able to do offset of 500,500 but can surely do 512,512 or things like that. It might save you cycles for extra copies.

    Regards,

    Anshuman

    PS: Please mark this post as verified, if you think this has answered your question. Thanks. 

  • Anshuman Saxena said:

    Hi,

    There are multiple ways of doing this:

    1. Assuming you are using oneshot capture mode, where capture is decoupled with resizer, then you can use resizer module once again in single shot mode to crop the data from 1920x1080 to 1000x1000 with startX and startY as 500,500.  This way you will have a cropped output of 1000x1000 that can be directly given to encoder. This can not work in continuous mode as the resizer would be directly connected to capture to give 1920x1080, and not be able to do the cropping separately.

    Is it possible to apply this method through DMAI library? It seems to me that it is not possible to select a desired starting offset. This  also seems to be confirmed looking at the DMAI source file Resize.c, where vert_starting_pixel and horz_starting_pixel are always set to 0. Could u confirm this to me? Moreover, I read on the DMAI's SVN repo that this functionality has been removed since the PSP resize driver itself does not support it. Is this true as well?

    Thanks

    Gabriele