IPSDK 4.2
IPSDK : Image Processing Software Development Kit
Split an image to a sequence of 2D ROIs
imagesplitRoiSeq2dImg (inSingleImg,roiSize,roiOffset)

Detailed Description

Split the input image into a sequence of ROIs.

This algorithm splits the input image into ROIs and stores theses ROIs as frames of a sequence image.

The ROIs are described by their size. The offset parameter indicates the number of pixels separating two consecutive ROIs. If the offset is lower than the ROI size, the ROI overlap.

If the last ROI along a direction does not fit the image range, it is shifted so that each pixel in the ROI can be assigned to a value.

Here is an example of split with one row of ROIs for clarity:

splitRoiSeq2dImg.png

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLUtility as util

Code Example

# opening of input image
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
# image split
outImg = util.splitRoiSeq2dImg(inImg, roiSize, roiOffset)

Example of C++ code :

Example informations

Header file

#include <IPSDKIPL/IPSDKIPLUtility/Processor/SplitRoiSeq2dImg/SplitRoiSeq2dImg.h>

Code Example

// opening input image
ImageGeometryPtr pImageGeometry = geometry2d(imageBufferType, sizeX, sizeY);
ImagePtr pInImg = loadRawImageFile(inputImgPath, *pImageGeometry);
// Split the image
ImagePtr pOutImg = splitRoiSeq2dImg(pInImg, roiSize, roiOffset);