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

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

Public Member Functions

None __init__ (self)
 Constructs a eVision.EFourierImage image.
None __init__ (self, eVision.EFrequentialDomainFormat domainFormat)
 Constructs a eVision.EFourierImage image.
None __init__ (self, eVision.EFrequentialDomainFormat domainFormat, int width, int height)
 Constructs a eVision.EFourierImage image.
None __init__ (self, eVision.EFrequentialDomainFormat domainFormat, int width, int height, eVision.EBW32f constant)
 Constructs a eVision.EFourierImage image.
None __init__ (self, eVision.EFourierImage other)
 Constructs a eVision.EFourierImage image.
None InitializeFromUnalignedBuffer (self, int width, int height, ctypes.c_void_p buffer, int pitch)
 Initializes image from an unaligned buffer.
None InitializeFromUnalignedBuffer (self, int width, int height, ctypes.c_void_p buffer)
 Initializes image from an unaligned buffer.
None ComputeMagnitude (self, eVision.EImageBW8 dest)
 Computes and outputs the magnitude of each pixel into a new image.
None ComputeMagnitude (self, eVision.EImageBW32f dest)
 Computes and outputs the magnitude of each pixel into a new image.
None ComputePhase (self, eVision.EImageBW8 dest)
 Computes and outputs the phase of each pixel into a new image.
None ComputePhase (self, eVision.EImageBW32f dest)
 Computes and outputs the phase of each pixel into a new image.
None Shift (self)
 Rearranges this Fourier transform by shifting the zero-frequency component to the center of the image.
None Shift (self, eVision.EFourierImage dest)
 Rearranges this Fourier transform by shifting the zero-frequency component to the center of the image.
None Mask (self, eVision.EFourierImage dest, eVision.ERegion mask)
 Applies a mask, an element wise multiplication between pixel values of the mask (represented as a grayscale image) with the complex number of the fourier image.
None Mask (self, eVision.EFourierImage dest, eVision.EImageBW8 region)
 Applies a mask, an element wise multiplication between pixel values of the mask (represented as a grayscale image) with the complex number of the fourier image.
None InverseShift (self)
 Inverses rearrangement of eVision.EFourierImage.Shift.
None InverseShift (self, eVision.EFourierImage dest)
 Inverses rearrangement of eVision.EFourierImage.Shift.
None ExtractReal (self, eVision.EImageBW32f dest)
 Extract the real components.
None ExtractImaginary (self, eVision.EImageBW32f dest)
 Extract the imaginary components.
ctypes.c_void_p GetImagePtr (self)
 Returns a pointer to the pixel buffer.
None Save (self, str path)
 Save the eVision.EFourierImage object to the given file.
None Save (self, eVision.ESerializer|None serializer)
 Save the eVision.EFourierImage object to the given file.
None Load (self, str path)
 Load the eVision.EFourierImage object from the given file.
None Load (self, eVision.ESerializer|None serializer)
 Load the eVision.EFourierImage object from the given file.
None Load (self, str path, eVision.EFrequentialDomainFormat domainFormat)
 Restores an image stored in the given file.
None SaveImage (self, str path)
 Saves the content of this complex image to a Tiff file.
None SetImagePtr (self, int width, int height, ctypes.c_void_p imagePointer, eVision.EFrequentialDomainFormat domainFormat, int bitsPerRow)
 Sets the pointer to an externally allocated image buffer.
None SetImagePtr (self, int width, int height, ctypes.c_void_p imagePointer, eVision.EFrequentialDomainFormat domainFormat)
 Sets the pointer to an externally allocated image buffer.
None UseExternalBuffer (self, int width, int height, ctypes.c_void_p buffer, eVision.EFrequentialDomainFormat domainFormat, int rowPitch)
 Sets the pointer to an externally allocated image buffer.
None SetSize (self, int width, int height)
 Sets the width and height.
bool IsVoid (self)
 Tests whether if the topmost parent image of this hierarchy has a zero size.
None CopyTo (self, eVision.EFourierImage other)
 Copies all the data of the current eVision.EFourierImage object into another eVision.EFourierImage object.
eVision.EFrequentialDomainFormat FrequentialDomainFormat (self)
 Returns the frequential domain format.
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 Width (self)
 Gets the width of the underlying image.
int Height (self)
 Gets the height of the underlying image.
int BitsPerPixel (self)
 Gets the number of storage bits per pixel.
int PlanesPerPixel (self)
 Gets the number of color components in each pixel of the image.
eVision.EImageType Type (self)
 Gets the image pixel type, as defined by the EImageType enumeration.

Static Public Member Functions

None ShiftMask (eVision.ERegion region, eVision.ERegion shiftedRegion, int regionWidth, int regionHeight)
 Shifts the mask that can be a region or a grayscale image.
None ShiftMask (eVision.EImageBW8 mask, eVision.EImageBW8 shiftedMask)
 Shifts the mask that can be a region or a grayscale image.

Protected Member Functions

 _IsShifted__setter (self, bool value)
 Sets whether the image has been shifted by eVision.EFourierImage.Shift.

Properties

 IsShifted

Detailed Description

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

See ROIs.

Remarks:

License(s): BasicTypes

Constructor & Destructor Documentation

◆ __init__() [1/5]

None eVision.EFourierImage.__init__ ( self)

Constructs a eVision.EFourierImage image.

Remarks:

The constructor with no arguments creates a zero-sized image. You can modify the image size by calling eVision.EBaseROI.SetSize method.

The sizing constructor constructs an image of the given size. See eVision.EBaseROI.SetSize for informations about the sizing restrictions.

The copy constructor copies all the supplied image properties (content, attributes, sub-ROIs...) into the current object. Note that if you used eVision.EFourierImage.UseExternalBuffer to assign an external buffer to the image, that buffer will not be copied, the resulting image will just point to the same buffer as the original.

◆ __init__() [2/5]

None eVision.EFourierImage.__init__ ( self,
eVision.EFrequentialDomainFormat domainFormat )

Constructs a eVision.EFourierImage image.

Remarks:

The constructor with no arguments creates a zero-sized image. You can modify the image size by calling eVision.EBaseROI.SetSize method.

The sizing constructor constructs an image of the given size. See eVision.EBaseROI.SetSize for informations about the sizing restrictions.

The copy constructor copies all the supplied image properties (content, attributes, sub-ROIs...) into the current object. Note that if you used eVision.EFourierImage.UseExternalBuffer to assign an external buffer to the image, that buffer will not be copied, the resulting image will just point to the same buffer as the original.

Parameters
domainFormatThe eVision.EFrequentialDomainFormat of the eVision.EFourierImage.

◆ __init__() [3/5]

None eVision.EFourierImage.__init__ ( self,
eVision.EFrequentialDomainFormat domainFormat,
int width,
int height )

Constructs a eVision.EFourierImage image.

Remarks:

The constructor with no arguments creates a zero-sized image. You can modify the image size by calling eVision.EBaseROI.SetSize method.

The sizing constructor constructs an image of the given size. See eVision.EBaseROI.SetSize for informations about the sizing restrictions.

The copy constructor copies all the supplied image properties (content, attributes, sub-ROIs...) into the current object. Note that if you used eVision.EFourierImage.UseExternalBuffer to assign an external buffer to the image, that buffer will not be copied, the resulting image will just point to the same buffer as the original.

Parameters
domainFormatThe eVision.EFrequentialDomainFormat of the eVision.EFourierImage.
widthThe width, in pixels.
heightThe height, in pixels.

◆ __init__() [4/5]

None eVision.EFourierImage.__init__ ( self,
eVision.EFrequentialDomainFormat domainFormat,
int width,
int height,
eVision.EBW32f constant )

Constructs a eVision.EFourierImage image.

Remarks:

The constructor with no arguments creates a zero-sized image. You can modify the image size by calling eVision.EBaseROI.SetSize method.

The sizing constructor constructs an image of the given size. See eVision.EBaseROI.SetSize for informations about the sizing restrictions.

The copy constructor copies all the supplied image properties (content, attributes, sub-ROIs...) into the current object. Note that if you used eVision.EFourierImage.UseExternalBuffer to assign an external buffer to the image, that buffer will not be copied, the resulting image will just point to the same buffer as the original.

Parameters
domainFormatThe eVision.EFrequentialDomainFormat of the eVision.EFourierImage.
widthThe width, in pixels.
heightThe height, in pixels.
constantGray-level constant.

◆ __init__() [5/5]

None eVision.EFourierImage.__init__ ( self,
eVision.EFourierImage other )

Constructs a eVision.EFourierImage image.

Remarks:

The constructor with no arguments creates a zero-sized image. You can modify the image size by calling eVision.EBaseROI.SetSize method.

The sizing constructor constructs an image of the given size. See eVision.EBaseROI.SetSize for informations about the sizing restrictions.

The copy constructor copies all the supplied image properties (content, attributes, sub-ROIs...) into the current object. Note that if you used eVision.EFourierImage.UseExternalBuffer to assign an external buffer to the image, that buffer will not be copied, the resulting image will just point to the same buffer as the original.

Parameters
otherAnother eVision.EFourierImage object.

Member Function Documentation

◆ _IsShifted__setter()

eVision.EFourierImage._IsShifted__setter ( self,
bool value )
protected

Sets whether the image has been shifted by eVision.EFourierImage.Shift.

◆ BitsPerPixel()

int eVision.EFourierImage.BitsPerPixel ( self)

Gets the number of storage bits per pixel.

◆ ColPitch()

int eVision.EFourierImage.ColPitch ( self)

Gets the pitch of a column (number of bytes between two horizontally adjacent pixels).

◆ ComputeMagnitude() [1/2]

None eVision.EFourierImage.ComputeMagnitude ( self,
eVision.EImageBW32f dest )

Computes and outputs the magnitude of each pixel into a new image.

A normalization is applied when outputting a eVision.EImageBW8 image so that every magnitude values lies inside the [0; 255] range. This is useful when visualizing.

Parameters
destThe image that will contain the magnitude.

◆ ComputeMagnitude() [2/2]

None eVision.EFourierImage.ComputeMagnitude ( self,
eVision.EImageBW8 dest )

Computes and outputs the magnitude of each pixel into a new image.

A normalization is applied when outputting a eVision.EImageBW8 image so that every magnitude values lies inside the [0; 255] range. This is useful when visualizing.

Parameters
destThe image that will contain the magnitude.

◆ ComputePhase() [1/2]

None eVision.EFourierImage.ComputePhase ( self,
eVision.EImageBW32f dest )

Computes and outputs the phase of each pixel into a new image.

A normalization is applied when outputting into a eVision.EImageBW8 image so that every magnitude values lie inside the [0; 255] range. This is useful when visualizing.

Parameters
destThe image that will contain the phase.

◆ ComputePhase() [2/2]

None eVision.EFourierImage.ComputePhase ( self,
eVision.EImageBW8 dest )

Computes and outputs the phase of each pixel into a new image.

A normalization is applied when outputting into a eVision.EImageBW8 image so that every magnitude values lie inside the [0; 255] range. This is useful when visualizing.

Parameters
destThe image that will contain the phase.

◆ CopyTo()

None eVision.EFourierImage.CopyTo ( self,
eVision.EFourierImage other )

Copies all the data of the current eVision.EFourierImage object into another eVision.EFourierImage object.

Parameters
otherAn eVision.EFourierImage object in which the current eVision.EFourierImage object data have to be copied.

◆ ExtractImaginary()

None eVision.EFourierImage.ExtractImaginary ( self,
eVision.EImageBW32f dest )

Extract the imaginary components.

When the frequential domain format is extended, this is equivalent to extract all columns whose indices are odd. If the format is EFrequentialDomainFormat_Packed, an implicit conversion to the extended format is applied before extracting.

Parameters
destImage contains the real components

◆ ExtractReal()

None eVision.EFourierImage.ExtractReal ( self,
eVision.EImageBW32f dest )

Extract the real components.

When the frequential domain format is extended, this is equivalent to extract all columns whose indices are even. If the format is EFrequentialDomainFormat_Packed, an implicit conversion to the extended format is applied before extracting.

Parameters
destImage contains the real components

◆ FrequentialDomainFormat()

eVision.EFrequentialDomainFormat eVision.EFourierImage.FrequentialDomainFormat ( self)

Returns the frequential domain format.

◆ GetImagePtr()

ctypes.c_void_p eVision.EFourierImage.GetImagePtr ( self)

Returns a pointer to the pixel buffer.

◆ Height()

int eVision.EFourierImage.Height ( self)

Gets the height of the underlying image.

◆ InitializeFromUnalignedBuffer() [1/2]

None eVision.EFourierImage.InitializeFromUnalignedBuffer ( self,
int width,
int height,
ctypes.c_void_p buffer )

Initializes image from an unaligned buffer.

Remarks:

The image will be initialized to fit the width and height passed as arguments. The contents of the buffer will then be copied into the image. The buffer contents must be compatible with the pixel type of the image.

Parameters
widthWidth of the image in the buffer.
heightHeight of the image in the buffer.
bufferAddress of the buffer.

◆ InitializeFromUnalignedBuffer() [2/2]

None eVision.EFourierImage.InitializeFromUnalignedBuffer ( self,
int width,
int height,
ctypes.c_void_p buffer,
int pitch )

Initializes image from an unaligned buffer.

Remarks:

The image will be initialized to fit the width and height passed as arguments. The contents of the buffer will then be copied into the image. The buffer contents must be compatible with the pixel type of the image.

Parameters
widthWidth of the image in the buffer.
heightHeight of the image in the buffer.
bufferAddress of the buffer.
pitchPitch of the buffer (in bytes). If omitted, the method assumes there is no padding (the pitch is assumed be equal (width * sizeOfAPixel))

◆ InverseShift() [1/2]

None eVision.EFourierImage.InverseShift ( self)

Inverses rearrangement of eVision.EFourierImage.Shift.

Shift and InverseShift can only be applied on an EFourierImage when its format is EFrequentialDomainFormat_ComplexExtended. Will throw an exception if it's not the case. Will throw an exception if the method is applied on an image that hasn't been shifted first with eVision.EFourierImage.Shift.

Remarks:

When not referencing an image, the method is applied in-place.

◆ InverseShift() [2/2]

None eVision.EFourierImage.InverseShift ( self,
eVision.EFourierImage dest )

Inverses rearrangement of eVision.EFourierImage.Shift.

Shift and InverseShift can only be applied on an EFourierImage when its format is EFrequentialDomainFormat_ComplexExtended. Will throw an exception if it's not the case. Will throw an exception if the method is applied on an image that hasn't been shifted first with eVision.EFourierImage.Shift.

Remarks:

When not referencing an image, the method is applied in-place.

Parameters
destThe image that will contain the shifted image.

◆ IsVoid()

bool eVision.EFourierImage.IsVoid ( self)

Tests whether if the topmost parent image of this hierarchy has a zero size.

◆ Load() [1/3]

None eVision.EFourierImage.Load ( self,
eVision.ESerializer | None serializer )

Load the eVision.EFourierImage object from the given file.

Object is loaded assuming the file is in Euresys proprietary format.

Parameters
serializerThe eVision.ESerializer file-like object that is read from.

◆ Load() [2/3]

None eVision.EFourierImage.Load ( self,
str path )

Load the eVision.EFourierImage object from the given file.

Object is loaded assuming the file is in Euresys proprietary format.

Parameters
pathThe full path of the file to be loaded.

◆ Load() [3/3]

None eVision.EFourierImage.Load ( self,
str path,
eVision.EFrequentialDomainFormat domainFormat )

Restores an image stored in the given file.

Parameters
pathFull path of the file.
domainFormatFrequential domain format of the loaded image.

◆ Mask() [1/2]

None eVision.EFourierImage.Mask ( self,
eVision.EFourierImage dest,
eVision.EImageBW8 region )

Applies a mask, an element wise multiplication between pixel values of the mask (represented as a grayscale image) with the complex number of the fourier image.

When using a region as a mask, element of this fourier image contained in the region coordinates will be nullified.

Remarks:

The mask is expected to have the same dimension as the spatial image used to compute this fourier transform result. The masking of a packed EFourierImage and the masking of a complex extended EFourierImage computed from the direct fourier transform of the same image yield an equivalent EFourierImage only if:

  • The specified mask is symmetrically central.
  • The first and last columns are vertically symmetric. For more flexibility, use a EFourierImage in the complex extended format.
Parameters
destMasked frequency image.
regionRegion to use as a mask.

◆ Mask() [2/2]

None eVision.EFourierImage.Mask ( self,
eVision.EFourierImage dest,
eVision.ERegion mask )

Applies a mask, an element wise multiplication between pixel values of the mask (represented as a grayscale image) with the complex number of the fourier image.

When using a region as a mask, element of this fourier image contained in the region coordinates will be nullified.

Remarks:

The mask is expected to have the same dimension as the spatial image used to compute this fourier transform result. The masking of a packed EFourierImage and the masking of a complex extended EFourierImage computed from the direct fourier transform of the same image yield an equivalent EFourierImage only if:

  • The specified mask is symmetrically central.
  • The first and last columns are vertically symmetric. For more flexibility, use a EFourierImage in the complex extended format.
Parameters
destMasked frequency image.
maskGrayscale image to use as a mask.

◆ PlanesPerPixel()

int eVision.EFourierImage.PlanesPerPixel ( self)

Gets the number of color components in each pixel of the image.

◆ RowPitch()

int eVision.EFourierImage.RowPitch ( self)

Gets the pitch of a row (the number of bytes between two vertically adjacent pixels).

◆ Save() [1/2]

None eVision.EFourierImage.Save ( self,
eVision.ESerializer | None serializer )

Save the eVision.EFourierImage object to the given file.

Object is saved using the Euresys proprietary file format.

Parameters
serializerThe eVision.ESerializer file-like object that is written to.

◆ Save() [2/2]

None eVision.EFourierImage.Save ( self,
str path )

Save the eVision.EFourierImage object to the given file.

Object is saved using the Euresys proprietary file format.

Parameters
pathThe full path of the destination file.

◆ SaveImage()

None eVision.EFourierImage.SaveImage ( self,
str path )

Saves the content of this complex image to a Tiff file.

Parameters
pathPath to the file to save to.

◆ SetImagePtr() [1/2]

None eVision.EFourierImage.SetImagePtr ( self,
int width,
int height,
ctypes.c_void_p imagePointer,
eVision.EFrequentialDomainFormat domainFormat )

Sets the pointer to an externally allocated image buffer.

Deprecated

Use eVision.EFourierImage.UseExternalBuffer instead.

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

Parameters
widthThe width of the supplied buffer, in pixels.
heightThe height of the supplied buffer, in pixels.
imagePointerThe pointer (aligned on 4 bytes) to the buffer, which must be large enough to hold the image.
domainFormatFrequential domain format of the loaded image.

◆ SetImagePtr() [2/2]

None eVision.EFourierImage.SetImagePtr ( self,
int width,
int height,
ctypes.c_void_p imagePointer,
eVision.EFrequentialDomainFormat domainFormat,
int bitsPerRow )

Sets the pointer to an externally allocated image buffer.

Deprecated

Use eVision.EFourierImage.UseExternalBuffer instead.

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

Parameters
widthThe width of the supplied buffer, in pixels.
heightThe height of the supplied buffer, in pixels.
imagePointerThe pointer (aligned on 4 bytes) to the buffer, which must be large enough to hold the image.
domainFormatFrequential domain format of the loaded image.
bitsPerRowThe total number of bits contained in a row, padding included. Using the value 0 (default) means that this size is computed from the buffer width and the pixel size plus a padding with the smallest possible value that leads to a multiple of 4 bytes (32 bits), which is the minimum padding accepted by eVision.EFourierImage.UseExternalBuffer.

◆ SetSize()

None eVision.EFourierImage.SetSize ( self,
int width,
int height )

Sets the width and height.

Parameters
widthThe new requested image width.
heightThe new requested image height.

◆ Shift() [1/2]

None eVision.EFourierImage.Shift ( self)

Rearranges this Fourier transform by shifting the zero-frequency component to the center of the image.

Shift and InverseShift can only be applied on an EFourierImage when its format is EFrequentialDomainFormat_ComplexExtended. This method will throw an exception if it's not the case. Will throw an exception if the method is applied on an image that has already been shifted first with eVision.EFourierImage.Shift.

Remarks:

When using the no-argument overload, the method is applied in-place.

◆ Shift() [2/2]

None eVision.EFourierImage.Shift ( self,
eVision.EFourierImage dest )

Rearranges this Fourier transform by shifting the zero-frequency component to the center of the image.

Shift and InverseShift can only be applied on an EFourierImage when its format is EFrequentialDomainFormat_ComplexExtended. This method will throw an exception if it's not the case. Will throw an exception if the method is applied on an image that has already been shifted first with eVision.EFourierImage.Shift.

Remarks:

When using the no-argument overload, the method is applied in-place.

Parameters
destThe image that will contain the shifted image.

◆ ShiftMask() [1/2]

None eVision.EFourierImage.ShiftMask ( eVision.EImageBW8 mask,
eVision.EImageBW8 shiftedMask )
static

Shifts the mask that can be a region or a grayscale image.

This method can be used in case eVision.EFourierImage.Mask is applied on a previously shifted frequency image, and if the mask isn't centered properly.

Parameters
maskGrayscale image to use as a mask.
shiftedMaskShifted grayscale mask.

◆ ShiftMask() [2/2]

None eVision.EFourierImage.ShiftMask ( eVision.ERegion region,
eVision.ERegion shiftedRegion,
int regionWidth,
int regionHeight )
static

Shifts the mask that can be a region or a grayscale image.

This method can be used in case eVision.EFourierImage.Mask is applied on a previously shifted frequency image, and if the mask isn't centered properly.

Parameters
regionRegion to use as a mask.
shiftedRegionShifted region.
regionWidthWidth of the region.
regionHeightHeight of the region.

◆ Type()

eVision.EImageType eVision.EFourierImage.Type ( self)

Gets the image pixel type, as defined by the EImageType enumeration.

◆ UseExternalBuffer()

None eVision.EFourierImage.UseExternalBuffer ( self,
int width,
int height,
ctypes.c_void_p buffer,
eVision.EFrequentialDomainFormat domainFormat,
int rowPitch )

Sets the pointer to an externally allocated image buffer.

Parameters
widthThe width of the supplied buffer, in pixels.
heightThe height of the supplied buffer, in pixels.
bufferThe pointer (aligned on 4 bytes) to the buffer, which must be large enough to hold the image.
domainFormatFrequential domain format of the loaded image.
rowPitchThe total number of bytes contained in a row, padding included.

◆ Width()

int eVision.EFourierImage.Width ( self)

Gets the width of the underlying image.

Property Documentation

◆ IsShifted

eVision.EFourierImage.IsShifted
static
Initial value:
= property(None, _IsShifted__setter, None,
)