- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a matrix A of size mxn. I would like to make a reflective border around the boundary of matrix A. Could you please let me know how to do it by using Intel IPP?
Thank you very much,
Guangyi Chen
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
>>...matrix A of size mxn...
It's clear.
>>...a reflective border around the boundary of matrix A...
Sorry, I didn't understand your question. What is a reflective border?
Do youwant to do somethingwith a matrix usingclassic Reflection Operations of theLinear Algebra?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
if it's about image processing - you can use the next functions:
/* ////////////////////////////////////////////////////////////////////////////
// Name: ippiCopyReplicateBorder
//
// Purpose: Copies pixel values between two buffers and adds
// the replicated border pixels.
//
// Returns:
// ippStsNullPtrErr One of the pointers is NULL
// ippStsSizeErr 1). srcRoiSize or dstRoiSize has a field with negative or zero value
// 2). topBorderHeight or leftBorderWidth is less than zero
// 3). dstRoiSize.width < srcRoiSize.width + leftBorderWidth
// 4). dstRoiSize.height < srcRoiSize.height + topBorderHeight
// ippStsStepErr srcStep or dstStep is less than or equal to zero
// ippStsNoErr OK
//
// Parameters:
// pSrc Pointer to the source image buffer
// srcStep Step in bytes through the source image
// pDst Pointer to the destination image buffer
// dstStep Step in bytes through the destination image
// scrRoiSize Size of the source ROI in pixels
// dstRoiSize Size of the destination ROI in pixels
// topBorderHeight Height of the top border in pixels
// leftBorderWidth Width of the left border in pixels
*/
/* ////////////////////////////////////////////////////////////////////////////
// Name: ippiCopyConstBorder
//
// Purpose: Copies pixel values between two buffers and adds
// the border pixels with constant value.
//
// Returns:
// ippStsNullPtrErr One of the pointers is NULL
// ippStsSizeErr 1). srcRoiSize or dstRoiSize has a field with negative or zero value
// 2). topBorderHeight or leftBorderWidth is less than zero
// 3). dstRoiSize.width < srcRoiSize.width + leftBorderWidth
// 4). dstRoiSize.height < srcRoiSize.height + topBorderHeight
// ippStsStepErr srcStep or dstStep is less than or equal to zero
// ippStsNoErr OK
//
// Parameters:
// pSrc Pointer to the source image buffer
// srcStep Step in bytes through the source image
// pDst Pointer to the destination image buffer
// dstStep Step in bytes through the destination image
// srcRoiSize Size of the source ROI in pixels
// dstRoiSize Size of the destination ROI in pixels
// topBorderHeight Height of the top border in pixels
// leftBorderWidth Width of the left border in pixels
// value Constant value to assign to the border pixels
*/
/* ////////////////////////////////////////////////////////////////////////////
// Name: ippiCopyWrapBorder
//
// Purpose: Copies pixel values between two buffers and adds the border pixels.
//
// Returns:
// ippStsNullPtrErr One of the pointers is NULL
// ippStsSizeErr 1). srcRoiSize or dstRoiSize has a field with negative or zero value
// 2). topBorderHeight or leftBorderWidth is less than zero
// 3). dstRoiSize.width < srcRoiSize.width + leftBorderWidth
// 4). dstRoiSize.height < srcRoiSize.height + topBorderHeight
// ippStsStepErr srcStep or dstStep is less than or equal to zero
// ippStsNoErr OK
//
// Parameters:
// pSrc Pointer to the source image buffer
// srcStep Step in bytes through the source image
// pDst Pointer to the destination image buffer
// dstStep Step in bytes through the destination image
// scrRoiSize Size of the source ROI in pixels
// dstRoiSize Size of the destination ROI in pixels
// topBorderHeight Height of the top border in pixels
// leftBorderWidth Width of the left border in pixels
*/
Regards,
Igor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Border pixels reflection is a "mirror" border type in IPP. Imagine we've got vector of the len 5 with elements: "1 2 3 4 5" and we whould like to get mirrororedborder in the lenght of 2. Then in result of it we obtain vector in the len of 9 with the elements "3 2 1 2 3 4 5 4 3". So in case of matrixes you need to relflect every row, then reflect every column.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Use ippiCopyReplicateBorder for rows
- Transpose a matrix
- Use ippiCopyReplicateBorder for rows
- Transpose a matrix
In case of a matrixcould itbe done in this way?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Regards,
Igor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If a length is 2 at every corner there are 4values ( 2x2 block )and I wonder how these values will
be calculated?
Best regards,
Sergey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please note, that this function replicates boundary pixels: not reflects them. Let the input matrix 2x2 will be the following:
1 2
34
And we would like to get border in the length of 1. So after this function call you will get the following 4x4 matrix:
1 12 2
1 12 2
334 4
334 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
All corner values in the new matrixare replicated, not calculated.
Best regards,
Sergey

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page