Forums - How to work with ROI

5 posts / 0 new
Last post
How to work with ROI
lomelina
Join Date: 6 Dec 13
Posts: 4
Posted: Tue, 2014-04-08 12:39

Hi All,

I have an image, but only a part of it is really interesting to me. So let's say that I would like to apply some transform on a region with widthXheight (e.g. 64x64), and this region is located at coordinates 100x100.

The stride value for mostof the functions help if the region's line starts at 0. I think that for this purpose I need to copy the region to a separate image. But do you know a function in fastcv that can copy some specific ROI?

Thank you,

Lubos

  • Up0
  • Down0
jeff4s Moderator
Join Date: 4 Nov 12
Posts: 106
Posted: Tue, 2014-04-08 23:12

Hi,

With stride parameter it's easy to specify ROI in an image. You set source pointer (usually src by convention) to the top left corner of ROI, and srcWidth and srcHeight to be the width and height of the desired ROI. Then you specify stride of the original image so that memory access is correctly handled by the API.

Hope this is clear.

Cheers,

-Jeff

  • Up0
  • Down0
lomelina
Join Date: 6 Dec 13
Posts: 4
Posted: Wed, 2014-04-09 05:04

Thank you Jef,

indeed that's the right thing. I don't know why but i was computing new stride for ROI which is wrong. Thank you for the help.

Anyway, for different purpouse, is there a function for copying part of the image somewhere else? To me this is like a basic functionality.

  • Up0
  • Down0
jeff4s Moderator
Join Date: 4 Nov 12
Posts: 106
Posted: Wed, 2014-04-09 09:40

The system function memcpy is already optimized for speed performance. There is no need to duplicate the function in FastCV.

Cheers,

-Jeff

  • Up0
  • Down0
lomelina
Join Date: 6 Dec 13
Posts: 4
Posted: Wed, 2014-04-09 12:53

I think memcpy with stride would do the job, but it doesn't support stride as far as I know.

One can always use a loop for that but ...

Lubos 

 

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.