User-defined Border Types
Mirrored Border with Replication
Border in Memory
- If you set theippBorderInMemvalue or its flags combinations, the function tries to access pixels outside of image borders to get border pixels for each filtering stage. For example, theippiMorphOpenBorderfunction uses two stages and with 5x5 mask will accessfloor(5/2)*2=4pixels in each direction across the current ROI.
- If you setippBorderFirstStageInMem, the function tries to accessfloor(5/2)=2pixels outside of the image borders to get pixels for the first stage of filtering. The second filter will use one of the following border types to reconstruct image borders:ippBorderRepl,ippBorderConst,ippBorderMirror, orippBorderMirrorR. To specify the border type for the second and next stages, use the bitwiseORoperation between one of the listed above border types andippBorderFirstStageInMem.
- First stage:squares marked in red correspond to pixels copied from the source image, which is the source image ROI, and squares marked in blue correspond to ROI assigned to the first stage filter. As you can see from the figure, the first stage enlarges ROI for top and right sides to consume more memory and provide valid pixels for the second stage memory border.
- Second stage:red squares and blue pixels correspond to resulting pixels from the first stage filter. Blue pixels lie outside of the ROI providing border values for the second stage in top and right directions. Left and bottom border pixels use the constant valueVin accordance with the border flags combination.