Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.
6404 Discussions

Advanced Tiling with valid image rectangle.

Kosh__Stephen
Beginner
401 Views

Hello, everyone!.

I' m Stephen Kosh.

I'm going to develop a vision software using OpenVX.

And i'm going to implement some features using Advanced Tiling Kernel.

But There is a serious problem.

Main problem is that the Input Image dimension is dynamic.

So I've build the graph with Very Large Image. for example 2048x2048.

And I use the some region of the image using vxSetValidImageRect function.

It's ok without tiling.

But with tiling, tiling is done by whole image dimension (for example. 2048x2048 to 10 pieces.).

I want to make the valid image rect tiling.

For example if the valid image rect of input image is 600x400, then I 'd like that only this rect is tiled as some pieces.

Am i wrong?

Then How to solve this problem?

Best Regards.

 

0 Kudos
2 Replies
Ryan_M_Intel1
Employee
401 Views

Hi Stephen,

It's a really good question and quite a tricky situation, but you can try the following approach. The advanced tiling mechanism within OpenVX works by having each node define a set of output tiles. The vx_mapping_intel_f  callback defined by the node is then called for each given output tile, for which the node specifies the input tile attributes (x,y,width,height) that are required to produce that given output tile.

I'm assuming that even though the input image is dynamic in size (well, at least within that 2048x2048 image), the output image is some fixed size. So, given whatever the output tile size that is chosen for this node (either being inherited from the graph, or explicitly defined by the node via the vx_kernel_set_tile_dimensions_intel_f callback), that fixed output size will be broken down into a specific set of output tiles, which are known at vxVerifyGraph-time. Your vx_mapping_intel_f callback will be invoked for each of those output tiles (this happens at vxVerifyGraph-time). For each given output tile, you need to define the input tile attributes (x,y,width,height) required for the node to produce that output tile. Since this happens at vxVerifyGraph, and you don't know where your "dynamic" image resides within your input 2048x2048 image yet, you can simply set the input tile attributes to the entire input image (0,0,2048,2048). Your vx_advanced_tiling_kernel_intel_f will be invoked to produce each output tile, and you'll have many of these (10 is what you specified above), so multithreading will still be achieved. You'll just need a way to inform your kernel for each execution what the new size of your input image is, which for example you can do by using some vx_scalar parameters and update these in-between each call to vxProcessGraph.

Let me know if you need clarification on my proposed strategy, or any other general questions. 

Best Regards,

Ryan

 

0 Kudos
Kosh__Stephen
Beginner
401 Views

Hi Ryan.

Thanks for your kindly response.

I’ve read your post and thanks again.

I sympathize with your opinion. Also I’ve been thinking this way.

 

Best Regards.

Stephen Kosh.

0 Kudos
Reply