This is an example of how to inspect sample images by using all the functions of seg module. More details about this example.
#define SR_FILTER_OBJECTS_BY_APPROXIMATE_SIZE
int main()
{
std::wstring data_dir = L"../../../examples/data";
std::wstring trainedModelPath = data_dir + L"/models/pcb_sample_model.srSeg";
std::vector<std::wstring> imagePaths(4);
imagePaths[0] = data_dir + L"/images/PCB/Image-1.png";
imagePaths[1] = data_dir + L"/images/PCB/Image-2.png";
imagePaths[2] = data_dir + L"/images/PCB/Image-3.png";
imagePaths[3] = data_dir + L"/images/PCB/Image-4.png";
unsigned char* ucImageData = nullptr;
unsigned int* uiImageData = nullptr;
int verbosity = 3;
double overlayAlpha = 0.7;
int displayTime = 100;
double resizeFactor = 0.5;
int gpuIndex = 0;
{
std::wcout << "Saige Vision failed: Please check the file path of trained model." << std::endl;
}
{
PrintErrorType(srStatus, verbosity);
return -1;
}
{
PrintErrorType(srStatus, verbosity);
return -1;
}
int numberOfClassesOutput = 0;
int maxStrLenOfClassName = 0;
{
PrintErrorType(srStatus, verbosity);
return -1;
}
{
PrintErrorType(srStatus, verbosity);
return -1;
}
std::vector<std::string> classNames(numberOfClassesOutput);
std::vector<std::wstring> wClassNames(numberOfClassesOutput);
std::vector<int> classColorsOutput(numberOfClassesOutput);
char* classNameOutput = new char[maxStrLenOfClassName];
wchar_t* wClassNameOutput = new wchar_t[maxStrLenOfClassName];
for (int i = 0; i < numberOfClassesOutput; i++)
{
{
PrintErrorType(srStatus, verbosity);
return -1;
}
{
PrintErrorType(srStatus, verbosity);
return -1;
}
{
PrintErrorType(srStatus, verbosity);
return -1;
}
classNames[i] = classNameOutput;
wClassNames[i] = wClassNameOutput;
}
delete[] classNameOutput;
delete[] wClassNameOutput;
std::vector<int> scoreThresholdOutput(numberOfClassesOutput);
std::vector<int> pixelSizeThresholdOutput(numberOfClassesOutput);
{
PrintErrorType(srStatus, verbosity);
return -1;
}
{
PrintErrorType(srStatus, verbosity);
return -1;
}
# ifdef SR_USE_NEW_SCORE_THRESHOLD
std::vector<int> scoreThreshold(numberOfClassesOutput);
for (int i = 0; i < numberOfClassesOutput; i++)
{
scoreThreshold[i] = 100;
}
{
PrintErrorType(srStatus, verbosity);
return -1;
}
#endif
# ifdef SR_USE_NEW_PIXEL_SIZE_THRESHOLD
std::vector<int> pixelSizeThreshold(numberOfClassesOutput);
for (int i = 0; i < numberOfClassesOutput; i++)
{
pixelSizeThreshold[i] = 200;
}
{
PrintErrorType(srStatus, verbosity);
return -1;
}
pixelSizeThresholdOutput = pixelSizeThreshold;
#endif
#if (!defined(SR_FILTER_OBJECTS_BY_EXACT_SIZE)) && (!defined(SR_FILTER_OBJECTS_BY_APPROXIMATE_SIZE))
{
PrintErrorType(srStatus, verbosity);
return -1;
}
#endif
#ifdef SR_FILTER_OBJECTS_BY_EXACT_SIZE
{
PrintErrorType(srStatus, verbosity);
return -1;
}
#endif
#ifdef SR_FILTER_OBJECTS_BY_APPROXIMATE_SIZE
{
PrintErrorType(srStatus, verbosity);
return -1;
}
#endif
#ifdef SR_FILTER_OBJECTS_BY_REGION
{
PrintErrorType(srStatus, verbosity);
return -1;
}
std::vector<float> filterObjSimpleParams(4);
filterObjSimpleParams[0] = 0.1f;
filterObjSimpleParams[1] = 0.1f;
filterObjSimpleParams[2] = 0.8f;
filterObjSimpleParams[3] = 0.8f;
{
PrintErrorType(srStatus, verbosity);
return -1;
}
#endif
#ifdef SR_CROP_AND_STORE_SEGMENTED_OBJECT
int cropSize = 256;
{
PrintErrorType(srStatus, verbosity);
return -1;
}
#endif
#ifdef SR_GET_SCORES_OF_SEGMENTED_OBJECT
{
PrintErrorType(srStatus, verbosity);
return -1;
}
#endif
#ifdef SR_GET_AVERAGE_COLOR_OF_SEGMENTED_OBJECT
{
PrintErrorType(srStatus, verbosity);
return -1;
}
#endif
#ifdef SR_MATRIX_OUTPUT_WITH_CV_CONTOUR_FLAG
{
PrintErrorType(srStatus, verbosity);
return -1;
}
#endif
#ifdef SR_USE_FORWARD_TIME_LIMIT
float timeLimit = 1000;
{
PrintErrorType(srStatus, verbosity);
return -1;
}
#endif
#ifndef SR_USE_FORWARD_TIME_LIMIT
{
PrintErrorType(srStatus, verbosity);
return -1;
}
#endif
{
PrintErrorType(srStatus, verbosity);
return -1;
}
for (size_t i_img = 0; i_img < imagePaths.size(); i_img++)
{
int h = 0, w = 0;
switch (inputImageType)
{
case eSRInputImageType::UCGrayImage:
case eSRInputImageType::UCColorImage:
case eSRInputImageType::UCGrayImage16Bit:
case eSRInputImageType::UCColorImage16Bit:
ucImageData = (unsigned char*)GetImageDataByInputImageType(imagePaths[i_img], inputImageType, h, w);
break;
case eSRInputImageType::UIColorImage:
case eSRInputImageType::UIColorImage16Bit:
uiImageData = (unsigned int*)GetImageDataByInputImageType(imagePaths[i_img], inputImageType, h, w);
break;
}
if (inputImageType == eSRInputImageType::ImageFilePathMultiByteChar)
{
size_t sizeOfChar = 0;
size_t sizeOfWChar = wcslen(imagePaths[i_img].c_str());
size_t bufferSize = sizeOfWChar * 2;
std::vector<char> imagePathMB(bufferSize);
sizeOfChar = wcstombs(
imagePathMB.data(),
imagePaths[i_img].c_str(),
bufferSize
);
if (sizeOfChar != sizeOfWChar)
{
std::wcout << "Saige Vision FAILED: Wrong Image path" << imagePaths[i_img] << std::endl;
continue;
}
}
else if (inputImageType == eSRInputImageType::ImageFilePathWideChar)
{
}
else if (inputImageType == eSRInputImageType::UCGrayImage)
{
}
else if (inputImageType == eSRInputImageType::UCColorImage)
{
}
else if (inputImageType == eSRInputImageType::UIColorImage)
{
}
else if (inputImageType == eSRInputImageType::UCGrayImage16Bit)
{
}
else if (inputImageType == eSRInputImageType::UCColorImage16Bit)
{
}
else if (inputImageType == eSRInputImageType::UIColorImage16Bit)
{
}
{
PrintErrorType(srStatus, verbosity);
if (verbosity >= 3)
{
DisplayFailedImageOnCVWindow(imagePaths[i_img], "FAIL TO segment", "segmentation Result", displayTime, resizeFactor);
}
continue;
}
if (inputImageType == eSRInputImageType::ImageFilePathWideChar || inputImageType == eSRInputImageType::ImageFilePathMultiByteChar)
{
{
PrintErrorType(srStatus, verbosity);
continue;
}
}
long inspectionTimeOutput = 0, loadImageTimeOutput = 0;
{
PrintErrorType(srStatus, verbosity);
continue;
}
{
PrintErrorType(srStatus, verbosity);
continue;
}
bool isExceededMaxInspectionSize = false;
{
PrintErrorType(srStatus, verbosity);
continue;
}
bool isImageCropped = false;
{
PrintErrorType(srStatus, verbosity);
continue;
}
int matrixChannelOutput = 0, matrixSizeOutput = 0;
std::vector<unsigned char> outputMatrix;
outputMode == SR_MULTI_CLASS_HEATMAP_OUTPUT)
{
{
PrintErrorType(srStatus, verbosity);
continue;
}
outputMatrix.resize(matrixSizeOutput);
{
PrintErrorType(srStatus, verbosity);
continue;
}
}
if (verbosity >= 2)
{
std::cout << "====== segmentation Test Result ======" << std::endl;
std::wcout << imagePaths[i_img] << std::endl;
std::cout << " - Image width, height: " << w << ", " << h << std::endl;
std::cout << " - Image Loading time: " << loadImageTimeOutput << std::endl;
std::cout << " - Inspection time: " << inspectionTimeOutput << std::endl;
std::cout << " - Is exceeded max inspection size: " << isExceededMaxInspectionSize << std::endl;
std::cout << " - Is image cropped: " << isImageCropped << std::endl << std::endl;
}
std::vector<SR_SegmentedObject> segmentedObject;
std::vector<SR_SegmentedObject> deletedObject;
{
int nSegmentedObjects = 0;
{
PrintErrorType(srStatus, verbosity);
continue;
}
segmentedObject.resize(nSegmentedObjects);
{
PrintErrorType(srStatus, verbosity);
continue;
}
if (verbosity >= 2)
{
std::cout << " - the number of segmented objects: " << segmentedObject.size() << std::endl;
for (int i = 0; i < segmentedObject.size(); i++)
{
std::cout << " - " << i << "-th segmented objects : " <<
"class[" << segmentedObject[i].classIdx << "], " <<
"area[" << segmentedObject[i].area << "], " <<
"width[" << segmentedObject[i].width << "], " <<
"height[" << segmentedObject[i].height << "], " <<
"x_center[" << segmentedObject[i].xCenter << "], " <<
"y_center[" << segmentedObject[i].yCenter << "], " <<
"scores(average, min, max)[" << segmentedObject[i].scores[0] << ", "
<< segmentedObject[i].scores[1] << ", "
<< segmentedObject[i].scores[2] << "], "
"average_color(B, G, R)[" << segmentedObject[i].averageColor[0] << ", " <<
segmentedObject[i].averageColor[1] << ", " <<
segmentedObject[i].averageColor[2] << "]" << std::endl;
}
}
int nDeletedObjects = 0;
{
PrintErrorType(srStatus, verbosity);
continue;
}
deletedObject.resize(nDeletedObjects);
{
PrintErrorType(srStatus, verbosity);
continue;
}
if (verbosity >= 2)
{
std::cout << " - the number of deleted objects: " << deletedObject.size() << std::endl;
}
}
if (verbosity >= 3)
{
cv::Mat image = cv::Mat();
if (inputImageType == eSRInputImageType::UCGrayImage)
{
image = cv::Mat(h, w, CV_8UC1, ucImageData);
image = image.clone();
}
else if (inputImageType == eSRInputImageType::UCColorImage)
{
image = cv::Mat(h, w, CV_8UC3, ucImageData);
image = image.clone();
}
else if (inputImageType == eSRInputImageType::UIColorImage)
{
image = cv::Mat(h, w, CV_8UC4, uiImageData);
image = image.clone();
}
else if (inputImageType == eSRInputImageType::UCGrayImage16Bit)
{
image = cv::Mat(h, w, CV_16UC1, ucImageData);
image.convertTo(image, CV_8U, 1.0 / 256.0);
image = image.clone();
}
else if (inputImageType == eSRInputImageType::UCColorImage16Bit)
{
image = cv::Mat(h, w, CV_16UC3, ucImageData);
image.convertTo(image, CV_8U, 1.0 / 256.0);
image = image.clone();
}
else if (inputImageType == eSRInputImageType::UIColorImage16Bit)
{
image = cv::Mat(h, w, CV_16UC4, uiImageData);
image.convertTo(image, CV_8U, 1.0 / 256.0);
image = image.clone();
}
else
{
int isSuccess = OpenImageFile(imagePaths[i_img].c_str(), image);
if (isSuccess == 0)
{
std::cout << "Saige Vision FAILED: Fail to open image file to display" << std::endl;
continue;
}
}
{
if (image.channels() == 4)
{
cv::cvtColor(image, image, cv::COLOR_BGRA2BGR);
}
cv::Mat imageCheck = image.clone();
unsigned char* data = imageCheck.data;
{
if (image.channels() == 1)
{
for (int i_pixel = 0; i_pixel < matrixSizeOutput; i_pixel++)
{
if (outputMatrix[i_pixel] > 0)
{
data[i_pixel] = outputMatrix[i_pixel];
}
}
}
else if (image.channels() == 3)
{
for (int i_pixel = 0; i_pixel < matrixSizeOutput; i_pixel++)
{
if (outputMatrix[i_pixel] > 0)
{
data[3 * i_pixel + 0] = 0;
data[3 * i_pixel + 1] = 0;
data[3 * i_pixel + 2] = outputMatrix[i_pixel];
}
}
}
}
{
cv::Scalar whiteScalar = cv::Scalar(255.0);
if (image.channels() == 1)
{
whiteScalar = cv::Scalar(255.0);
}
else if (image.channels() == 3)
{
whiteScalar = cv::Scalar(0, 0, 255.0);
}
for (int i_c = 0; i_c < segmentedObject.size(); i_c++)
{
std::vector<std::vector<cv::Point>> contours;
std::vector<cv::Vec4i> hierarchy;
convertSRSegmentedObjectToOpencvFormat(segmentedObject[i_c], contours, hierarchy);
cv::drawContours(imageCheck, contours, -1, whiteScalar, -1, 8, hierarchy);
}
}
cv::Mat finalUnifiedImage;
double beta = 1.0 - overlayAlpha;
double gamma = 0;
cv::addWeighted(image, overlayAlpha, imageCheck, beta, gamma, finalUnifiedImage);
cv::namedWindow("Segmentation Result", cv::WINDOW_NORMAL);
cv::resizeWindow("Segmentation Result", w * resizeFactor, h * resizeFactor);
cv::imshow("Segmentation Result", finalUnifiedImage);
cv::waitKey(displayTime);
}
{
if (image.channels() == 4)
{
cv::cvtColor(image, image, cv::COLOR_BGRA2BGR);
}
else if (image.channels() == 1)
{
cv::cvtColor(image, image, cv::COLOR_GRAY2BGR);
}
cv::Mat imageCheck = image.clone();
{
unsigned char* data = imageCheck.data;
for (int i_pixel = 0; i_pixel < w * h; i_pixel++)
{
int maxVal = 0;
int channel = 0;
for (int c = 0; c < numberOfClassesOutput; c++)
{
if (outputMatrix[i_pixel + c * w * h] > maxVal)
{
maxVal = outputMatrix[i_pixel + c * w * h];
channel = c;
}
}
unsigned char* tmp = (unsigned char*)(&classColorsOutput[channel]);
int b = 0, g = 0, r = 0;
std::memcpy(&b, tmp, 1);
std::memcpy(&g, tmp + 1, 1);
std::memcpy(&r, tmp + 2, 1);
if (maxVal != 0)
{
data[3 * i_pixel + 0] = b * (maxVal / 255.0);
data[3 * i_pixel + 1] = g * (maxVal / 255.0);
data[3 * i_pixel + 2] = r * (maxVal / 255.0);
}
}
}
{
for (int i_c = 0; i_c < segmentedObject.size(); i_c++)
{
unsigned char* tmp = (unsigned char*)(&classColorsOutput[segmentedObject[i_c].classIdx]);
int b = 0, g = 0, r = 0;
std::memcpy(&b, tmp, 1);
std::memcpy(&g, tmp + 1, 1);
std::memcpy(&r, tmp + 2, 1);
cv::Scalar overlayScalar = cv::Scalar(b, g, r);
std::vector<std::vector<cv::Point>> contours;
std::vector<cv::Vec4i> hierarchy;
convertSRSegmentedObjectToOpencvFormat(segmentedObject[i_c], contours, hierarchy);
cv::drawContours(imageCheck, contours, -1, overlayScalar, -1, 8, hierarchy);
}
}
cv::Mat finalUnifiedImage;
double beta = 1.0 - overlayAlpha;
double gamma = 0.0;
cv::addWeighted(image, overlayAlpha, imageCheck, beta, gamma, finalUnifiedImage);
cv::namedWindow("Segmentation Result", cv::WINDOW_NORMAL);
cv::resizeWindow("Segmentation Result", w * resizeFactor, h * resizeFactor);
cv::imshow("Segmentation Result", finalUnifiedImage);
cv::waitKey(displayTime);
#ifdef SR_CROP_AND_STORE_SEGMENTED_OBJECT
for (int i_c = 0; i_c < segmentedObject.size(); i_c++)
{
if (segmentedObject[i_c].croppedImage != nullptr)
{
int dataType = CV_MAKETYPE(CV_8U, segmentedObject[i_c].croppedImageChannels);
cv::Mat croppedImage = cv::Mat(segmentedObject[i_c].croppedImageHeight, segmentedObject[i_c].croppedImageWidth, dataType, segmentedObject[i_c].croppedImage);
cv::namedWindow("Segmentation Cropped Image", cv::WINDOW_NORMAL);
cv::resizeWindow("Segmentation Cropped Image", croppedImage.size().width, croppedImage.size().height);
cv::imshow("Segmentation Cropped Image", croppedImage);
cv::waitKey(displayTime);
}
}
#endif
}
}
if (ucImageData != nullptr)
{
delete[] ucImageData;
}
if (uiImageData != nullptr)
{
delete[] uiImageData;
}
}
{
PrintErrorType(srStatus, verbosity);
return -1;
}
{
PrintErrorType(srStatus, verbosity);
return -1;
}
std::cout << "SaigeVision successfully completed, please press enter key to terminate" << std::endl;
std::cin.get();
return 0;
}
Header file of util functions for example projects.
eSRInputImageType
Data Type of input Image for example projects.
Definition: SRUtils.h:23
Header file for segmentation module.
eErrorType SR_PrintSegTestParametersWithoutBG(SegTestHandle handle)
Print a model parameters (Segmentation's class information, inspection options...)
@ SR_ONE_CLASS_CV_CONTOUR_OUTPUT
Definition: SegmentationTestDLL.h:63
@ SR_MULTI_CLASS_CV_CONTOUR_OUTPUT
Definition: SegmentationTestDLL.h:64
@ SR_ONE_CLASS_MATRIX_OUTPUT
Definition: SegmentationTestDLL.h:61
@ SR_MULTI_CLASS_MATRIX_OUTPUT
Definition: SegmentationTestDLL.h:62
eErrorType SR_LoadSegTestNetworkInGPU(SegTestHandle handle, int GPUNumber, int batchSize=1)
Allocate required cpu & gpu memory.
eErrorType SR_SetSegTestMinPixelSizeThresholdWithoutBG(SegTestHandle handle, int numOfClasses, int *areaThreshold, bool writeOnModelFile=true)
Set Segmentation's area threshold for each class.
eErrorType SR_GetSegTestMinPixelSizeThresholdWithoutBG(SegTestHandle handle, int *areaThreshold)
Get Segmentation's area threshold for each class.
eErrorType SR_SetSegTestModeOfFilteringByPixelSize(SegTestHandle handle, eModeOfPixelSizeFilter modeOfFiltering, bool writeOnModelFile=true)
Set the mode of filtering by Segmentation's area threshold.
eErrorType SR_SetSegTestIsToCalcAverageColor(SegTestHandle handle, bool isToCalcAverageColors, bool writeOnModelFile=true)
Set the boolean indicating whether calculate SR_SegmentedObject::averageColor or not.
eErrorType SR_GetSegTestOneClassNameWithWideCharByIdxWithoutBG(SegTestHandle handle, const int classIdx, wchar_t *className)
Get a wide char name of certain class by given index.
eErrorType SR_GetSegTestMaxStrLenOfClassName(SegTestHandle handle, int *len)
Get a maximum length of class name.
eErrorType SR_GetSegTestNumberOfClassesWithoutBG(SegTestHandle handle, int *numberOfClasses)
Get the number of classes.
eErrorType SR_GetSegTestOneClassNameWithMultiByteCharByIdxWithoutBG(SegTestHandle handle, const int classIdx, char *className)
Get a multi byte char name of certain class by given index.
eErrorType SR_GetSegTestOneClassColorByIdxWithoutBG(SegTestHandle handle, const int classIdx, int *classColor)
Get a color of certain class by given index.
eErrorType SR_SetSegTestIsToStoreCroppedImage(SegTestHandle handle, bool isToStoreCroppedImage, int defaultCropSize, eModeOfCropLargeObjects modeOfCropLargeObjects=SR_CROP_BY_OBJECTSIZE_N_RESIZE_TO_CROPSIZE, float margin=0.05, bool writeOnModelFile=true)
Set the parameters of Segmentation's crop object.
eErrorType SR_SetSegFilterObjSimpleParameters(SegTestHandle handle, float *simpleParams, bool writeOnModelFile=true)
Set the simple parameters of filtering object by Segmentation's filter object by region.
eErrorType SR_SetSegFilterObjByRegion(SegTestHandle handle, eFilterObjByRegionType filterObjType, bool writeOnModelFile=true)
Set the filtering object type by Segmentation's filter object by region.
eErrorType SR_SetSegTestForwardTimeLimitVariables(SegTestHandle handle, float forwardTimeLimit, bool bIsToUseForwardTimeLimit, bool writeOnModelFile=true)
Set the Forward time limit variables.
eErrorType SR_SetSegTestIsToUseForwardTimeLimit(SegTestHandle handle, bool bIsToUseForwardTimeLimit, bool writeOnModelFile=true)
Set the boolean whether the current model is using time limit or not.
void * SegTestHandle
Segmentation file handler.
Definition: SegmentationTestDLL.h:90
eErrorType SR_CreateSegTestHandleByWideCharPath_ErrorType(SegTestHandle *segTestHandle, const wchar_t *filePath)
Create a SegTestHandle via wide char path.
void * SegTestResult
Segmentation inspection results handler.
Definition: SegmentationTestDLL.h:105
eErrorType SR_MakeSegTestResult_ErrorType(SegTestResult *segTestResult)
Construct a SegTestResult.
eErrorType SR_DestroySegTestHandle(SegTestHandle handle)
Destruct a SegTestHandle.
eErrorType SR_DeleteSegTestResult(SegTestResult segTestResult)
Destruct a SegTestResult.
eErrorType SR_SetSegTestIsMatrixOutputIncluded(SegTestHandle handle, bool isMatrixOutputIncluded, bool writeOnModelFile=true)
Set the boolean indicating whether include matrix output or not.
eErrorType SR_ApplySegTestFromImageFileByWideCharPath(SegTestHandle handle, const wchar_t *imagePath, SegTestResult segTestResult, int flag)
Apply segmentation algorithm to image by file path.
eErrorType SR_ApplySegTestFromUnsignedIntColorArray(SegTestHandle handle, const unsigned int *imageData, const int height, const int width, SegTestResult segTestResult, int flag)
Apply segmentation algorithm to 4-channels(BGRA) image by 8-bit data.
eErrorType SR_ApplySegTestFrom8bitCharColorArray(SegTestHandle handle, const unsigned char *imageData, const int height, const int width, SegTestResult segTestResult, int flag)
Apply segmentation algorithm to 3-channels(BGR) image by 8-bit data.
eErrorType SR_ApplySegTestFrom16bitCharGrayArray(SegTestHandle handle, const unsigned char *imageData, const int height, const int width, SegTestResult segTestResult, int flag)
Apply segmentation algorithm to 1-channel image by 16-bit data.
eErrorType SR_ApplySegTestFrom8bitCharGrayArray(SegTestHandle handle, const unsigned char *imageData, const int height, const int width, SegTestResult segTestResult, int flag)
Apply segmentation algorithm to 1-channel image by 8-bit data.
eErrorType SR_ApplySegTestFromImageFile(SegTestHandle handle, const char *imagePath, SegTestResult segTestResult, int flag)
Apply segmentation algorithm to image by file path.
eErrorType SR_ApplySegTestFrom16bitCharColorArray(SegTestHandle handle, const unsigned char *imageData, const int height, const int width, SegTestResult segTestResult, int flag)
Apply segmentation algorithm to 3-channels(BGR) image by 16-bit data.
eErrorType SR_ApplySegTestFrom16bitUnsignedIntColorArray(SegTestHandle handle, const unsigned int *imageData, const int height, const int width, SegTestResult segTestResult, int flag)
Apply segmentation algorithm to 4-channels(BGRA) image by 16-bit data.
eErrorType SR_GetSegTestIsImageCropped(SegTestResult segTestResult, bool *isImageCropped)
Get whether the image is cropped due to lack of GPU memory.
eErrorType SR_GetSegTestDeletedObjects(SegTestResult segTestResult, SR_SegmentedObject *deletedObjects)
Get deleted SR_SegmentedObject s by filter process Segmentation's area threshold.
eErrorType SR_GetSegTestLoadImageTime(SegTestResult segTestResult, long *imageLoadingTimeInLong)
Get the image loading time.
eErrorType SR_GetSegTestNumberOfDeletedObjects(SegTestResult segTestResult, int *numberOfDeletedObjects)
Get the number of deleted SR_SegmentedObject s by filter process Segmentation's area threshold.
eErrorType SR_GetSegTestInspectionTime(SegTestResult segTestResult, long *inspectionTimeInLong)
Get the inspection time.
eErrorType SR_GetSegTestOutputMatrix(SegTestResult segTestResult, int scoreMatrixSize, unsigned char *scoreMatrixData)
Get Score matrix.
eErrorType SR_GetSegTestNumberOfSegmentedObjects(SegTestResult segTestResult, int *numberOfSegmentedObjects)
Get the number of SR_SegmentedObject.
eErrorType SR_GetSegTestResultOriginalImageSize(SegTestResult segTestResult, int *width, int *height)
Get the size of inspected image.
eErrorType SR_GetSegTestIsExceededMaxInspectionSize(SegTestResult segTestResult, bool *isExceededMaxInspectionSize)
Get whether the size of inspected image exceeds max inspection size.
eErrorType SR_GetSegTestSegmentedObjects(SegTestResult segTestResult, SR_SegmentedObject *segmentedObjects)
Get SR_SegmentedObject s.
eErrorType SR_GetSegTestOutputMatrixSizeInfo(SegTestResult segTestResult, int *scoreMatrixChannel, int *scoreMatrixSize)
Get the size of Score matrix.
eErrorType SR_SetSegTestIsToCalcObjectScores(SegTestHandle handle, bool isToCalcObjectScores, bool writeOnModelFile=true)
Set the boolean indicating whether calculate SR_SegmentedObject::scores or not.
eErrorType SR_GetSegTestMinScoreThresholdWithoutBG(SegTestHandle handle, int *scoreThreshold)
Get Segmentation's score threshold for each class.
eErrorType SR_SetSegTestMinScoreThresholdWithoutBG(SegTestHandle handle, int numOfClasses, int *scoreThreshold, bool writeOnModelFile=true)
Set Segmentation's score threshold for each class.