The primary purpose of the image class is to provide a structure that
can transform an image back and fourth for different python libraries
such as PIL, OpenCV, and Scipy Images. This class also allows some simple
operations on the image such as annotation.
|
__init__(self,
data,
bw_annotate=False)
Create an image from a file or a PIL Image, OpenCV Image, or numpy
array. |
source code
|
|
|
asBW(self)
Returns:
a gray-scale version of this pyvision image |
source code
|
|
|
|
|
|
|
|
|
|
|
asOpenCV2(self)
Returns:
the image data in an OpenCV format that is a numpy array of shape
(h,w,3) of uint8 |
source code
|
|
|
asOpenCV2BW(self)
Returns:
the image data in an OpenCV format that is a numpy array of shape
(h,w,1) of uint8 |
source code
|
|
|
|
|
asThermal(self,
clip_negative=False)
Returns:
a thermal colored representation of this image. |
source code
|
|
|
|
|
|
|
|
|
getExif(self,
output=' simple ' )
This function returns the exif headers for an image. |
source code
|
|
|
annotateRect(self,
rect,
color=' red ' ,
fill_color=None,
alpha=1.0)
Draws a rectangle on the annotation image |
source code
|
|
|
|
|
|
|
|
|
annotateLine(self,
point1,
point2,
color=' red ' ,
width=1)
Draws a line from point1 to point2 on the annotation image |
source code
|
|
|
annotateLines(self,
points,
color=' red ' ,
width=1)
Draws a line from point1 to point2 on the annotation image |
source code
|
|
|
|
|
annotatePolygon(self,
points,
color=' red ' ,
width=1,
fill=None)
Draws a line from point1 to point2 on the annotation image |
source code
|
|
|
|
|
|
|
|
|
annotateArc(self,
point,
radius=3,
startangle=0,
endangle=360,
color=' red ' )
Draws a circular arc on the image. |
source code
|
|
|
annotateLabel(self,
point,
label,
color=' red ' ,
mark=False,
font=None,
background=None)
Marks a point in the image with text |
source code
|
|
|
|
|
valueNormalize(self)
TODO: Deprecated remove this sometime. |
source code
|
|
|
getType(self)
Return the type of the image. |
source code
|
|
|
normalize(self)
Equalize and normalize the image. |
source code
|
|
|
|
|
_generateMatrix2D(self)
Create a matrix version of the image. |
source code
|
|
|
_generateMatrix3D(self)
Create a matrix version of the image. |
source code
|
|
|
_generatePIL(self)
Create a PIL version of the image |
source code
|
|
|
|
|
_generateOpenCV2(self)
Create a matrix version of the image compatible with OpenCV 2 (cv2)
in BGR format. |
source code
|
|
|
_generateOpenCV2BW(self)
Create a matrix version of the image compatible with OpenCV 2 (cv2)
in BGR format. |
source code
|
|
|
|
|
toBufferRGB(self,
depth)
returns the image data as a binary python string. |
source code
|
|
|
|
|
thumbnail(self,
newSize)
Returns a resized version of the image that fits in new_size but
preserves the aspect ratio. |
source code
|
|
|
|
|
|
|
copy(self)
Returns a new pv.Image which is a copy of (only) the current image. |
source code
|
|
pv.Image
|
crop(self,
rect,
size=None,
interpolation=None,
return_affine=False)
Crops an image to the given rectangle. |
source code
|
|
|
save(self,
filename,
annotations=False)
Save the image to a file. |
source code
|
|
|
show(self,
window=None,
pos=None,
delay=0,
size=None)
Displays the annotated version of the image using OpenCV highgui |
source code
|
|
|
|