Methods
(static) argmax(arr)
get the index of the max value of the array.
Parameters:
Name | Type | Description |
---|---|---|
arr |
array |
Returns:
the index of the max value of the array
(static) crop(img, cropSize)
image center crop.
Parameters:
Name | Type | Description |
---|---|---|
img |
image mat | |
cropSize |
crop size [h, w] |
Returns:
cropped image
(static) drawBBoxes(img, bboxes, withLabel, withScore, thickness, lineType, fontFace, fontScale)
draw bboxes onto the image.
Parameters:
Name | Type | Description |
---|---|---|
img |
image mat | |
bboxes |
bboxes of detection | |
withLabel |
draw with label | |
withScore |
draw with score | |
thickness |
line thickness | |
lineType |
line type | |
fontFace |
font face | |
fontScale |
font scale |
Returns:
drawed image
(static) getColorMap(labelList)
get color map of label list.
Parameters:
Name | Type | Description |
---|---|---|
labelList |
label list |
Returns:
color map of label list
(static) getIMScale(height, width, targetSize, keepRatio, limitMax)
get image scale.
Parameters:
Name | Type | Description |
---|---|---|
height |
image height | |
width |
image width | |
targetSize |
target size [h, w] | |
keepRatio |
is keep the ratio of image size | |
limitMax |
is limit max size of image |
Returns:
[scale factor of x axis, , scale factor of y axis]
(static) loadText(textURL)
load text content.
Parameters:
Name | Type | Description |
---|---|---|
textURL |
text URL |
Returns:
content of the text
(static) normalize(img, scale, mean, std, isScale)
image normalize.
Parameters:
Name | Type | Description |
---|---|---|
img |
image mat | |
scale |
normalize scale | |
mean |
normalize mean | |
std |
normalize std | |
isScale |
is scale the image |
Returns:
normalized image
(static) permute(img)
permute hwc -> chw.
Parameters:
Name | Type | Description |
---|---|---|
img |
image mat |
Returns:
image data
(static) resize(img, height, width, targetSize, keepRatio, limitMax, interp)
image resize.
Parameters:
Name | Type | Description |
---|---|---|
img |
image mat | |
height |
image height | |
width |
image width | |
targetSize |
target size [h, w] | |
keepRatio |
is keep the ratio of image size | |
limitMax |
is limit max size of image | |
interp |
interpolation method |
Returns:
[image resized, scale factor of x axis, , scale factor of y axis]
(static) rgba2bgr(imgRGBA)
RGBA -> BGR image.
Parameters:
Name | Type | Description |
---|---|---|
imgRGBA |
RGBA image |
Returns:
BGR image
(static) rgba2rgb(imgRGBA)
RGBA -> RGB image.
Parameters:
Name | Type | Description |
---|---|---|
imgRGBA |
RGBA image |
Returns:
RGB image