Skip to content

Commit

Permalink
changed image creation from handle
Browse files Browse the repository at this point in the history
  • Loading branch information
savuor committed Nov 22, 2016
1 parent e8d2aad commit 2c63d2b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
11 changes: 3 additions & 8 deletions samples/openvx/wrappers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,7 @@ int ovxDemo(std::string inputPath, UserMemoryMode mode)
}
else
{
vx_imagepatch_addressing_t addressing = Image::createAddressing(image);
const std::vector<vx_imagepatch_addressing_t> addrs(1, addressing);
const std::vector<void*> ptrs(1, image.data);
ivxImage = Image::createFromHandle(context, color, addrs, ptrs);
ivxImage = Image::createFromHandle(context, color, Image::createAddressing(image), image.data);
}

Image ivxResult;
Expand All @@ -100,10 +97,8 @@ int ovxDemo(std::string inputPath, UserMemoryMode mode)
{
//create vx_image based on user data, no copying required
output = cv::Mat(height, width, CV_8U, cv::Scalar(0));
vx_imagepatch_addressing_t addressing = Image::createAddressing(output);
const std::vector<vx_imagepatch_addressing_t> addrs(1, addressing);
const std::vector<void*> ptrs(1, output.data);
ivxResult = Image::createFromHandle(context, Image::matTypeToFormat(CV_8U), addrs, ptrs);
ivxResult = Image::createFromHandle(context, Image::matTypeToFormat(CV_8U),
Image::createAddressing(output), output.data);
}

Graph graph = createProcessingGraph(ivxImage, ivxResult);
Expand Down
11 changes: 3 additions & 8 deletions samples/openvx/wrappers_video.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,7 @@ int ovxDemo(std::string inputPath, UserMemoryMode mode)
}
else
{
vx_imagepatch_addressing_t addressing = Image::createAddressing(frame);
const std::vector<vx_imagepatch_addressing_t> addrs(1, addressing);
const std::vector<void*> ptrs(1, frame.data);
ivxImage = Image::createFromHandle(context, color, addrs, ptrs);
ivxImage = Image::createFromHandle(context, color, Image::createAddressing(frame), frame.data);
}

Image ivxResult;
Expand All @@ -109,10 +106,8 @@ int ovxDemo(std::string inputPath, UserMemoryMode mode)
{
//create vx_image based on user data, no copying required
output = cv::Mat(height, width, CV_8U, cv::Scalar(0));
vx_imagepatch_addressing_t addressing = Image::createAddressing(output);
const std::vector<vx_imagepatch_addressing_t> addrs(1, addressing);
const std::vector<void*> ptrs(1, output.data);
ivxResult = Image::createFromHandle(context, Image::matTypeToFormat(CV_8U), addrs, ptrs);
ivxResult = Image::createFromHandle(context, Image::matTypeToFormat(CV_8U),
Image::createAddressing(output), output.data);
}

Graph graph = createProcessingGraph(ivxImage, ivxResult);
Expand Down

0 comments on commit 2c63d2b

Please sign in to comment.