eVision Python API
Loading...
Searching...
No Matches
eVision.EROIBW32 Class Reference

The eVision.EROIBW32 class is used to represent rectangular regions of interest inside BW32 gray-level images. More...

Inheritance diagram for eVision.EROIBW32:
Collaboration diagram for eVision.EROIBW32:

Public Member Functions

None __init__ (self)
 Constructs the eVision.EROIBW32 object.
None __init__ (self, eVision.EROIBW32 other)
None SetPixel (self, eVision.EBW32 value, int x, int y)
 Allows writing a single pixel value in the ROI or image.
None SetUncheckedPixel (self, eVision.EBW32 value, int x, int y)
None Serialize (self, eVision.ESerializer|None serializer)
eVision.EROIBW32|None GetNextROI (self, eVision.EBaseROI|None startROI)
 Returns the next ROI in the list starting at startROI or null if there is no next ROI.
eVision.EBW32 GetUncheckedPixel (self, int x, int y)
eVision.EBW32 GetPixel (self, int x, int y)
 Allows reading a single pixel value in the ROI or image.
eVision.EROIBW32|None FirstSubROI (self)
 See GetFirstSubROI in the derived classes.
eVision.EROIBW32|None NextSiblingROI (self)
 This method returns the ROI that is the next sibling of this ROI.
eVision.EROIBW32|None Parent (self)
 Returns the hierarchical parent of this object.
eVision.EImageBW32|None TopParent (self)
 Returns the top parent of this object.
eVision.EImageBW32|None Image (self)
 Returns the image associated with this ROI, or NULL if there is no image associated.
eVision.EPixelViewBW32 PixelView (self)
 Returns a pixel view of the ROI, allowing usage of the pixels defined in that ROI with the buffer protocol in Python.
Public Member Functions inherited from eVision.EBaseROI
bool IsAttached (self)
 Returns true if the ROI is attached to an image.
bool IsAnROI (self)
 Tests whether this object is an ROI or an image.
bool HasSubROI (self, eVision.EBaseROI|None subROI)
 Tests whether this object has a given attached ROI.
eVision.EBaseROI|None GetNextSiblingSubROI (self, eVision.EBaseROI|None subROI)
 This method returns the ROI that is the next sibling of the supplied ROI in the list of sub-ROIs.
None SetImagePtr (self, int width, int height, ctypes.c_void_p imagePointer, int bitsPerRow)
 Sets the pointer to an externally allocated image buffer.
None SetImagePtr (self, int width, int height, ctypes.c_void_p imagePointer)
 Sets the pointer to an externally allocated image buffer.
None UseExternalBuffer (self, int width, int height, ctypes.c_void_p buffer, int rowPitch)
 Sets the pointer to an externally allocated image buffer.
ctypes.c_void_p GetImagePtr (self, int x, int y)
 Returns a pointer to the pixel at given coordinates within the image/ROI.
ctypes.c_void_p GetImagePtr (self)
 Returns a pointer to the pixel at given coordinates within the image/ROI.
None CropToImage (self)
 This method reduces the ROI size so that it is completely contained within its topmost parent image bounds (if such an image exists at the top of the hierarchy).
bool IsVoid (self)
 Tests if the topmost parent image of this hierarchy has a zero size.
None SetPlacement (self, int originX, int originY, int width, int height)
 Sets the placement of an ROI, relative to its parent ROI/image.
None SetPlacement (self, eVision.ERegion region, int paddingTop, int paddingBottom, int paddingLeft, int paddingRight)
 Sets the placement of an ROI, relative to its parent ROI/image.
None SetPlacement (self, eVision.ERegion region, int paddingTop, int paddingBottom, int paddingLeft)
 Sets the placement of an ROI, relative to its parent ROI/image.
None SetPlacement (self, eVision.ERegion region, int paddingTop, int paddingBottom)
 Sets the placement of an ROI, relative to its parent ROI/image.
None SetPlacement (self, eVision.ERegion region, int paddingTop)
 Sets the placement of an ROI, relative to its parent ROI/image.
None SetPlacement (self, eVision.ERegion region)
 Sets the placement of an ROI, relative to its parent ROI/image.
None SetPlacement (self, eVision.ERegion region, eVision.EFrame frame, int paddingTop, int paddingBottom, int paddingLeft, int paddingRight)
 Sets the placement of an ROI, relative to its parent ROI/image.
None SetPlacement (self, eVision.ERegion region, eVision.EFrame frame, int paddingTop, int paddingBottom, int paddingLeft)
 Sets the placement of an ROI, relative to its parent ROI/image.
None SetPlacement (self, eVision.ERegion region, eVision.EFrame frame, int paddingTop, int paddingBottom)
 Sets the placement of an ROI, relative to its parent ROI/image.
None SetPlacement (self, eVision.ERegion region, eVision.EFrame frame, int paddingTop)
 Sets the placement of an ROI, relative to its parent ROI/image.
None SetPlacement (self, eVision.ERegion region, eVision.EFrame frame)
 Sets the placement of an ROI, relative to its parent ROI/image.
list[eVision._eVision.EBaseROI|None] GetSubBaseROIs (self, bool recursive)
 Returns all the children, and possibly recursively all their children, too.
list[eVision._eVision.EBaseROI|None] GetSubBaseROIs (self)
 Returns all the children, and possibly recursively all their children, too.
eVision.EDragHandle HitTest (self, int x, int y, float zoomX, float zoomY, float panX, float panY)
 Detects if the cursor is placed over one of the dragging handles.
eVision.EDragHandle HitTest (self, int x, int y, float zoomX, float zoomY, float panX)
 Detects if the cursor is placed over one of the dragging handles.
eVision.EDragHandle HitTest (self, int x, int y, float zoomX, float zoomY)
 Detects if the cursor is placed over one of the dragging handles.
eVision.EDragHandle HitTest (self, int x, int y, float zoomX)
 Detects if the cursor is placed over one of the dragging handles.
eVision.EDragHandle HitTest (self, int x, int y)
 Detects if the cursor is placed over one of the dragging handles.
bool IsPointInside (self, eVision.EPoint position)
 Detects if the position is inside current ROI.
bool IsPixelInside (self, int x, int y)
 Detects if a pixel (given its x and y coordinates) is inside current ROI.
None Drag (self, eVision.EDragHandle dragHandle, int x, int y, float zoomX, float zoomY, float panX, float panY)
 Moves the specified handle to a new position and updates all placement parameters of the ROI.
None Drag (self, eVision.EDragHandle dragHandle, int x, int y, float zoomX, float zoomY, float panX)
 Moves the specified handle to a new position and updates all placement parameters of the ROI.
None Drag (self, eVision.EDragHandle dragHandle, int x, int y, float zoomX, float zoomY)
 Moves the specified handle to a new position and updates all placement parameters of the ROI.
None Drag (self, eVision.EDragHandle dragHandle, int x, int y, float zoomX)
 Moves the specified handle to a new position and updates all placement parameters of the ROI.
None Drag (self, eVision.EDragHandle dragHandle, int x, int y)
 Moves the specified handle to a new position and updates all placement parameters of the ROI.
None Detach (self)
None Attach (self, eVision.EBaseROI|None parent)
 This method attaches the ROI to another ROI or image.
None Attach (self, eVision.EBaseROI|None parent, int orgX, int orgY, int width, int height)
 This method attaches the ROI to another ROI or image.
None Attach (self, eVision.EBaseROI|None parent, int orgX, int orgY, int width)
 This method attaches the ROI to another ROI or image.
None Attach (self, eVision.EBaseROI|None parent, int orgX, int orgY)
 This method attaches the ROI to another ROI or image.
None Attach (self, eVision.EBaseROI|None parent, eVision.ERegion region, int paddingTop, int paddingBottom, int paddingLeft, int paddingRight)
 This method attaches the ROI to another ROI or image.
None Attach (self, eVision.EBaseROI|None parent, eVision.ERegion region, int paddingTop, int paddingBottom, int paddingLeft)
 This method attaches the ROI to another ROI or image.
None Attach (self, eVision.EBaseROI|None parent, eVision.ERegion region, int paddingTop, int paddingBottom)
 This method attaches the ROI to another ROI or image.
None Attach (self, eVision.EBaseROI|None parent, eVision.ERegion region, int paddingTop)
 This method attaches the ROI to another ROI or image.
None Attach (self, eVision.EBaseROI|None parent, eVision.ERegion region)
 This method attaches the ROI to another ROI or image.
None Attach (self, eVision.EBaseROI|None parent, eVision.ERegion region, eVision.EFrame frame, int paddingTop, int paddingBottom, int paddingLeft, int paddingRight)
 This method attaches the ROI to another ROI or image.
None Attach (self, eVision.EBaseROI|None parent, eVision.ERegion region, eVision.EFrame frame, int paddingTop, int paddingBottom, int paddingLeft)
 This method attaches the ROI to another ROI or image.
None Attach (self, eVision.EBaseROI|None parent, eVision.ERegion region, eVision.EFrame frame, int paddingTop, int paddingBottom)
 This method attaches the ROI to another ROI or image.
None Attach (self, eVision.EBaseROI|None parent, eVision.ERegion region, eVision.EFrame frame, int paddingTop)
 This method attaches the ROI to another ROI or image.
None Attach (self, eVision.EBaseROI|None parent, eVision.ERegion region, eVision.EFrame frame)
 This method attaches the ROI to another ROI or image.
None CopyTo (self, eVision.EBaseROI dest)
 Copies all the data of the current eVision.EBaseROI object into another eVision.EBaseROI object and returns it.
None SetSize (self, int width, int height)
 Sets the width and height of an ROI/image.
None SetSize (self, eVision.EBaseROI|None other)
 Sets the width and height of an ROI/image.
None DrawFrame (self, eVision.EDrawAdapter|None graphicContext, eVision.EFramePosition framePosition, bool handles, float zoomX, float zoomY, float panX, float panY)
 Draws a rectangular frame around an image or ROI.
None DrawFrame (self, eVision.EDrawAdapter|None graphicContext, eVision.EFramePosition framePosition, bool handles, float zoomX, float zoomY, float panX)
 Draws a rectangular frame around an image or ROI.
None DrawFrame (self, eVision.EDrawAdapter|None graphicContext, eVision.EFramePosition framePosition, bool handles, float zoomX, float zoomY)
 Draws a rectangular frame around an image or ROI.
None DrawFrame (self, eVision.EDrawAdapter|None graphicContext, eVision.EFramePosition framePosition, bool handles, float zoomX)
 Draws a rectangular frame around an image or ROI.
None DrawFrame (self, eVision.EDrawAdapter|None graphicContext, eVision.EFramePosition framePosition, bool handles)
 Draws a rectangular frame around an image or ROI.
None DrawFrame (self, eVision.EDrawAdapter|None graphicContext, bool handles, float zoomX, float zoomY, float panX, float panY)
 Draws a rectangular frame around an image or ROI.
None DrawFrame (self, eVision.EDrawAdapter|None graphicContext, bool handles, float zoomX, float zoomY, float panX)
 Draws a rectangular frame around an image or ROI.
None DrawFrame (self, eVision.EDrawAdapter|None graphicContext, bool handles, float zoomX, float zoomY)
 Draws a rectangular frame around an image or ROI.
None DrawFrame (self, eVision.EDrawAdapter|None graphicContext, bool handles, float zoomX)
 Draws a rectangular frame around an image or ROI.
None DrawFrame (self, eVision.EDrawAdapter|None graphicContext, bool handles)
 Draws a rectangular frame around an image or ROI.
None Draw (self, eVision.EDrawAdapter|None graphicContext, float zoomX, float zoomY, float panX, float panY)
 Draws an ROI/image in a device context.
None Draw (self, eVision.EDrawAdapter|None graphicContext, float zoomX, float zoomY, float panX)
 Draws an ROI/image in a device context.
None Draw (self, eVision.EDrawAdapter|None graphicContext, float zoomX, float zoomY)
 Draws an ROI/image in a device context.
None Draw (self, eVision.EDrawAdapter|None graphicContext, float zoomX)
 Draws an ROI/image in a device context.
None Draw (self, eVision.EDrawAdapter|None graphicContext)
 Draws an ROI/image in a device context.
None Draw (self, eVision.EDrawAdapter|None graphicContext, eVision.EC24Vector|None c24Vector, float zoomX, float zoomY, float panX, float panY)
 Draws an ROI/image in a device context.
None Draw (self, eVision.EDrawAdapter|None graphicContext, eVision.EC24Vector|None c24Vector, float zoomX, float zoomY, float panX)
 Draws an ROI/image in a device context.
None Draw (self, eVision.EDrawAdapter|None graphicContext, eVision.EC24Vector|None c24Vector, float zoomX, float zoomY)
 Draws an ROI/image in a device context.
None Draw (self, eVision.EDrawAdapter|None graphicContext, eVision.EC24Vector|None c24Vector, float zoomX)
 Draws an ROI/image in a device context.
None Draw (self, eVision.EDrawAdapter|None graphicContext, eVision.EC24Vector|None c24Vector)
 Draws an ROI/image in a device context.
None Draw (self, eVision.EDrawAdapter|None graphicContext, eVision.EBW8Vector|None bw8Vector, float zoomX, float zoomY, float panX, float panY)
 Draws an ROI/image in a device context.
None Draw (self, eVision.EDrawAdapter|None graphicContext, eVision.EBW8Vector|None bw8Vector, float zoomX, float zoomY, float panX)
 Draws an ROI/image in a device context.
None Draw (self, eVision.EDrawAdapter|None graphicContext, eVision.EBW8Vector|None bw8Vector, float zoomX, float zoomY)
 Draws an ROI/image in a device context.
None Draw (self, eVision.EDrawAdapter|None graphicContext, eVision.EBW8Vector|None bw8Vector, float zoomX)
 Draws an ROI/image in a device context.
None Draw (self, eVision.EDrawAdapter|None graphicContext, eVision.EBW8Vector|None bw8Vector)
 Draws an ROI/image in a device context.
None Load (self, str path)
 Restores an image stored in the given file.
None Load (self, eVision.ESerializer|None serializer)
 Restores an image stored in the given file.
None Save (self, str path, eVision.EImageFileType type)
 Saves the eVision.EBaseROI object to the given file.
None Save (self, str path)
 Saves the eVision.EBaseROI object to the given file.
None Save (self, eVision.ESerializer|None serializer)
 Saves the eVision.EBaseROI object to the given file.
None SavePng (self, str path, int compression)
 Saves the eVision.EBaseROI object to the given file, in PNG format.
None SavePng (self, str path)
 Saves the eVision.EBaseROI object to the given file, in PNG format.
None SaveJpeg (self, str path, int quality)
 Saves the eVision.EBaseROI object to the given file, in JPEG format.
None SaveJpeg (self, str path)
 Saves the eVision.EBaseROI object to the given file, in JPEG format.
None SaveJpeg2K (self, str path, int quality)
 Saves the eVision.EBaseROI object to the given file, in JPEG 2000 format.
None SaveJpeg2K (self, str path)
 Saves the eVision.EBaseROI object to the given file, in JPEG 2000 format.
eVision.EBaseROI|None BaseTopParent (self)
 Returns the image at the top of the hierarchy, or NULL if there is no image on top.
eVision.EBaseROI|None BaseImage (self)
 Returns the image associated with this ROI, or NULL if there is no image associated.
int RowPitch (self)
 Gets the pitch of a row (the number of bytes between two vertically adjacent pixels).
int ColPitch (self)
 Gets the pitch of a column (number of bytes between two horizontally adjacent pixels).
int BitsPerPixel (self)
 Gets the number of storage bits per pixel.
int OrgX (self)
 Gets or sets the x-coordinate of the upper left corner of the ROI, relative to its parent ROI/image.
 OrgX (self, int value)
 Gets or sets the x-coordinate of the upper left corner of the ROI, relative to its parent ROI/image.
int OrgY (self)
 Gets or sets the y-coordinate of the upper left corner of the ROI, relative to its parent ROI/image.
 OrgY (self, int value)
 Gets or sets the y-coordinate of the upper left corner of the ROI, relative to its parent ROI/image.
int Width (self)
 If eVision.EBaseROI is a ROI, gets or sets the width of the ROI.
 Width (self, int value)
 If eVision.EBaseROI is a ROI, gets or sets the width of the ROI.
int Height (self)
 If eVision.EBaseROI is a ROI, gets or sets the height of the ROI.
 Height (self, int value)
 If eVision.EBaseROI is a ROI, gets or sets the height of the ROI.
int TotalOrgX (self)
 Gets the x-coordinate of the upper left pixel of the ROI, relative to its topmost parent upper left pixel.
int TotalOrgY (self)
 Gets the y-coordinate of the upper left pixel of the ROI, relative to its topmost parent upper left pixel.
int TotalWidth (self)
 Gets the width, in pixels, of the ROI topmost parent.
int TotalHeight (self)
 Gets the height, in pixels, of the ROI topmost parent.
int PlanesPerPixel (self)
 Gets the number of color components in each pixel of the ROI/image.
eVision.EColorSystem ColorSystem (self)
 Gets or sets the color system used by this image, as defined by the eVision.EColorSystem enumeration.
 ColorSystem (self, eVision.EColorSystem value)
 Gets or sets the color system used by this image, as defined by the eVision.EColorSystem enumeration.
eVision.EImageType Type (self)
 Gets the ROI/image pixel type, as defined by the eVision.EImageType enumeration.
str Author (self)
 Gets or sets the Author attribute of the ROI/image.
 Author (self, str value)
 Gets or sets the Author attribute of the ROI/image.
str Comment (self)
 Gets or sets the Comment attribute of the ROI/image.
 Comment (self, str value)
 Gets or sets the Comment attribute of the ROI/image.
str Date (self)
 Gets or sets the Date attribute of the ROI/image.
 Date (self, str value)
 Gets or sets the Date attribute of the ROI/image.
str Title (self)
 Gets or sets the Title attribute of the ROI/image.
 Title (self, str value)
 Gets or sets the Title attribute of the ROI/image.

Detailed Description

The eVision.EROIBW32 class is used to represent rectangular regions of interest inside BW32 gray-level images.

See ROIs.

Remarks:

License(s): BasicTypes

Constructor & Destructor Documentation

◆ __init__() [1/2]

None eVision.EROIBW32.__init__ ( self)

Constructs the eVision.EROIBW32 object.

◆ __init__() [2/2]

None eVision.EROIBW32.__init__ ( self,
eVision.EROIBW32 other )
Parameters
otherThe other eVision.EROIBW32 that we will copy into this one.

Member Function Documentation

◆ FirstSubROI()

eVision.EROIBW32 | None eVision.EROIBW32.FirstSubROI ( self)

See GetFirstSubROI in the derived classes.

Deprecated

Deprecated due to the high runtime cost on all operations of maintaining a ROI hierarchy.

If a ROI hierarchy is necessary it is now recommended to maintain it outside of ROI and Image classes.

Deprecated in version 26.10. Scheduled to be removed in version 27.10.

Reimplemented from eVision.EBaseROI.

◆ GetNextROI()

eVision.EROIBW32 | None eVision.EROIBW32.GetNextROI ( self,
eVision.EBaseROI | None startROI )

Returns the next ROI in the list starting at startROI or null if there is no next ROI.

Deprecated

Deprecated due to the high runtime cost on all operations of maintaining a ROI hierarchy.

If a ROI hierarchy is necessary it is now recommended to maintain it outside of ROI and Image classes.

Deprecated in version 26.10. Scheduled to be removed in version 27.10.

Parameters
startROIthe first ROI in the list.

Reimplemented from eVision.EBaseROI.

◆ GetPixel()

eVision.EBW32 eVision.EROIBW32.GetPixel ( self,
int x,
int y )

Allows reading a single pixel value in the ROI or image.

Remarks:

Although coordinates outside of the ROI can be supplied, this function will raise an error condition if the coordinates are outside of the top parent image.

It should be noted that calling this function several thousand times can be slow. The recommended way to access pixel content in an image or ROI is to use the eVision.EBaseROI.GetImagePtr and eVision.EBaseROI.UseExternalBuffer functions. For BW8 images/ROIs, using the C++ API only, it is possible to access pixels data faster through an intermediate object: EBW8PixelAccessor.

Parameters
xOffset of the pixel on the x axis.
yOffset of the pixel on the y axis.

◆ GetUncheckedPixel()

eVision.EBW32 eVision.EROIBW32.GetUncheckedPixel ( self,
int x,
int y )

◆ Image()

eVision.EImageBW32 | None eVision.EROIBW32.Image ( self)

Returns the image associated with this ROI, or NULL if there is no image associated.

◆ NextSiblingROI()

eVision.EROIBW32 | None eVision.EROIBW32.NextSiblingROI ( self)

This method returns the ROI that is the next sibling of this ROI.

Deprecated

Deprecated due to the high runtime cost on all operations of maintaining a ROI hierarchy.

If a ROI hierarchy is necessary it is now recommended to maintain it outside of ROI and Image classes.

Deprecated in version 26.10. Scheduled to be removed in version 27.10.

Reimplemented from eVision.EBaseROI.

◆ Parent()

eVision.EROIBW32 | None eVision.EROIBW32.Parent ( self)

Returns the hierarchical parent of this object.

Deprecated

Deprecated due to the high runtime cost on all operations of maintaining a ROI hierarchy.

If a ROI hierarchy is necessary it is now recommended to maintain it outside of ROI and Image classes.

Deprecated in version 26.10. Scheduled to be removed in version 27.10.

Reimplemented from eVision.EBaseROI.

◆ PixelView()

eVision.EPixelViewBW32 eVision.EROIBW32.PixelView ( self)

Returns a pixel view of the ROI, allowing usage of the pixels defined in that ROI with the buffer protocol in Python.

Example usage in Python:

import eVision
import numpy
image = EImageBW32(100, 100)
np_view = numpy.asarray(image.PixelView)

◆ Serialize()

None eVision.EROIBW32.Serialize ( self,
eVision.ESerializer | None serializer )
Deprecated

Use eVision.EBaseROI.Save or eVision.EBaseROI.Load instead.

Deprecated in version 24.10. Scheduled to be removed in version 27.6.

Reimplemented from eVision.EBaseROI.

Reimplemented in eVision.EImageBW32.

◆ SetPixel()

None eVision.EROIBW32.SetPixel ( self,
eVision.EBW32 value,
int x,
int y )

Allows writing a single pixel value in the ROI or image.

Remarks:

Although coordinates outside of the ROI can be supplied, this function will raise an error condition if the coordinates are outside of the top parent image.

It should be noted that calling this function several thousand times can be slow. The recommended way to access pixel content in an image or ROI is to use the eVision.EBaseROI.GetImagePtr and eVision.EBaseROI.UseExternalBuffer functions. For BW8 images/ROIs, using the C++ API only, it is possible to access pixels data faster through an intermediate object: EBW8PixelAccessor.

Parameters
valuevalue to set the pixel to.
xOffset of the pixel on the x axis.
yOffset of the pixel on the y axis.

◆ SetUncheckedPixel()

None eVision.EROIBW32.SetUncheckedPixel ( self,
eVision.EBW32 value,
int x,
int y )

◆ TopParent()

eVision.EImageBW32 | None eVision.EROIBW32.TopParent ( self)

Returns the top parent of this object.

Deprecated

Use eVision.EROIBW32.Image instead.

Deprecated in version 26.10. Scheduled to be removed in version 27.10.