OpenCV for Unity 2.6.4
Enox Software / Please refer to OpenCV official document ( http://docs.opencv.org/4.10.0/index.html ) for the details of the argument of the method.
Loading...
Searching...
No Matches
OpenCVForUnity.UnityUtils.DebugMatUtils Class Reference

Public Types

enum  DumpMode {
  GetRawTextureDataMode ,
  GetPixels32Mode
}
 Enum representing the methods for dumping texture data. More...
 
enum  LayoutType {
  TOP ,
  LEFT ,
  RIGHT ,
  BOTTOM
}
 Enum representing layout positions for displaying a group of images using the imshow method. More...
 

Static Public Member Functions

static void clear ()
 Destroys the DebugMatUtils GameObjects.
 
static void destroyAllWindows ()
 Destroys all opened windows.
 
static void destroyWindow (string winname)
 Destroys the specified window.
 
static void imshow (string winname, Mat img, bool dump, in Vec4i roi, string debugText=null, bool isDataSRGB=true)
 Displays a Mat image.
 
static void imshow (string winname, Mat img, bool dump, in(int x, int y, int width, int height) roi, string debugText=null, bool isDataSRGB=true)
 Displays a Mat image.
 
static void imshow (string winname, Mat img, bool dump=false, CoreModule.Rect roi=null, string debugText=null, bool isDataSRGB=true)
 Displays a Mat image.
 
static void imshow (string winname, Mat img, bool isDataSRGB)
 Displays a Mat image.
 
static void imshow (string winname, string debugText)
 Displays debug text.
 
static void imshow (string winname, Texture img, bool dump, DumpMode dumpMode, in Vec4i roi, string debugText=null)
 Displays a Texture image.
 
static void imshow (string winname, Texture img, bool dump, DumpMode dumpMode, in(int x, int y, int width, int height) roi, string debugText=null)
 Displays a Texture image.
 
static void imshow (string winname, Texture img, bool dump=false, DumpMode dumpMode=DumpMode.GetRawTextureDataMode, CoreModule.Rect roi=null, string debugText=null)
 Displays a Texture image.
 
static void setup (LayoutType type=LayoutType.RIGHT)
 Sets up the DebugMatUtils GameObject.
 

Member Enumeration Documentation

◆ DumpMode

Enum representing the methods for dumping texture data.

Enumerator
GetRawTextureDataMode 

Mode for retrieving texture data using the GetRawTextureData method.

GetPixels32Mode 

Mode for retrieving pixel data using the GetPixels32 method.

◆ LayoutType

Enum representing layout positions for displaying a group of images using the imshow method.

Enumerator
TOP 

Represents the top layout position.

LEFT 

Represents the left layout position.

RIGHT 

Represents the right layout position.

BOTTOM 

Represents the bottom layout position.

Member Function Documentation

◆ clear()

static void OpenCVForUnity.UnityUtils.DebugMatUtils.clear ( )
static

Destroys the DebugMatUtils GameObjects.

The clear method destroys GameObjects related to DebugMatUtils from the hierarchy.

◆ destroyAllWindows()

static void OpenCVForUnity.UnityUtils.DebugMatUtils.destroyAllWindows ( )
static

Destroys all opened windows.

The destroyAllWindows method removes all windows that are currently open. This is useful for cleaning up the display when no longer needed.

◆ destroyWindow()

static void OpenCVForUnity.UnityUtils.DebugMatUtils.destroyWindow ( string winname)
static

Destroys the specified window.

The destroyWindow method removes the window identified by the provided name from the display.

Parameters
winnameThe name of the window to be destroyed.

◆ imshow() [1/8]

static void OpenCVForUnity.UnityUtils.DebugMatUtils.imshow ( string winname,
Mat img,
bool dump,
in Vec4i roi,
string debugText = null,
bool isDataSRGB = true )
static

Displays a Mat image.

This method displays a Mat image.

If the image is 8-bit unsigned, it is displayed as is. If the image is 16-bit unsigned, the pixel values are divided by 256, mapping the value range [0, 255*256] to [0, 255]. If the image is 32-bit or 64-bit floating-point, the pixel values are multiplied by 255, mapping the value range [0, 1] to [0, 255]. 32-bit integer images are not supported due to ambiguity in the required transformation. If necessary, please preprocess the image to convert it to an 8-bit unsigned matrix. A new window will not be created if the number of image windows exceeds 50. Additionally, if a LayoutType is specified, please call the setup method() before the imshow method() is invoked for the first time.

Parameters
winnameThe name of the window. If the same name is already added, it will be overwritten.
imgThe Mat image to be displayed.
dumpSpecifies whether to display the result of the mat.dump() method.
roiThe part of the image to be displayed (extracts the intersecting area of img and roi).
debugTextThe debug text to be displayed in the InputField.
isDataSRGBThe isDataSRGB property of the Texture2D used when displaying the Mat image. If true, the data is assumed to be in sRGB color space.

◆ imshow() [2/8]

static void OpenCVForUnity.UnityUtils.DebugMatUtils.imshow ( string winname,
Mat img,
bool dump,
in(int x, int y, int width, int height) roi,
string debugText = null,
bool isDataSRGB = true )
static

Displays a Mat image.

This method displays a Mat image.

If the image is 8-bit unsigned, it is displayed as is. If the image is 16-bit unsigned, the pixel values are divided by 256, mapping the value range [0, 255*256] to [0, 255]. If the image is 32-bit or 64-bit floating-point, the pixel values are multiplied by 255, mapping the value range [0, 1] to [0, 255]. 32-bit integer images are not supported due to ambiguity in the required transformation. If necessary, please preprocess the image to convert it to an 8-bit unsigned matrix. A new window will not be created if the number of image windows exceeds 50. Additionally, if a LayoutType is specified, please call the setup method() before the imshow method() is invoked for the first time.

Parameters
winnameThe name of the window. If the same name is already added, it will be overwritten.
imgThe Mat image to be displayed.
dumpSpecifies whether to display the result of the mat.dump() method.
roiThe part of the image to be displayed (extracts the intersecting area of img and roi).
debugTextThe debug text to be displayed in the InputField.
isDataSRGBThe isDataSRGB property of the Texture2D used when displaying the Mat image. If true, the data is assumed to be in sRGB color space.

◆ imshow() [3/8]

static void OpenCVForUnity.UnityUtils.DebugMatUtils.imshow ( string winname,
Mat img,
bool dump = false,
CoreModule.Rect roi = null,
string debugText = null,
bool isDataSRGB = true )
static

Displays a Mat image.

This method displays a Mat image.

If the image is 8-bit unsigned, it is displayed as is. If the image is 16-bit unsigned, the pixel values are divided by 256, mapping the value range [0, 255*256] to [0, 255]. If the image is 32-bit or 64-bit floating-point, the pixel values are multiplied by 255, mapping the value range [0, 1] to [0, 255]. 32-bit integer images are not supported due to ambiguity in the required transformation. If necessary, please preprocess the image to convert it to an 8-bit unsigned matrix. A new window will not be created if the number of image windows exceeds 50. Additionally, if a LayoutType is specified, please call the setup method() before the imshow method() is invoked for the first time.

Parameters
winnameThe name of the window. If the same name is already added, it will be overwritten.
imgThe Mat image to be displayed.
dumpSpecifies whether to display the result of the mat.dump() method.
roiThe part of the image to be displayed (extracts the intersecting area of img and roi).
debugTextThe debug text to be displayed in the InputField.
isDataSRGBThe isDataSRGB property of the Texture2D used when displaying the Mat image. If true, the data is assumed to be in sRGB color space.

◆ imshow() [4/8]

static void OpenCVForUnity.UnityUtils.DebugMatUtils.imshow ( string winname,
Mat img,
bool isDataSRGB )
static

Displays a Mat image.

This method displays a Mat image.

If the image is 8-bit unsigned, it is displayed as is. If the image is 16-bit unsigned, the pixel values are divided by 256, mapping the value range [0, 255*256] to [0, 255]. If the image is 32-bit or 64-bit floating-point, the pixel values are multiplied by 255, mapping the value range [0, 1] to [0, 255]. 32-bit integer images are not supported due to ambiguity in the required transformation. If necessary, please preprocess the image to convert it to an 8-bit unsigned matrix. A new window will not be created if the number of image windows exceeds 50. Additionally, if a LayoutType is specified, please call the setup method() before the imshow method() is invoked for the first time.

Parameters
winnameThe name of the window. If the same name is already added, it will be overwritten.
imgThe Mat image to be displayed.
isDataSRGBThe isDataSRGB property of the Texture2D used when displaying the Mat image. If true, the data is assumed to be in sRGB color space.

◆ imshow() [5/8]

static void OpenCVForUnity.UnityUtils.DebugMatUtils.imshow ( string winname,
string debugText )
static

Displays debug text.

The imshow method displays the provided debug text in the InputField.

Parameters
winnameThe name of the window.
debugTextThe debug text to be displayed in the InputField.

◆ imshow() [6/8]

static void OpenCVForUnity.UnityUtils.DebugMatUtils.imshow ( string winname,
Texture img,
bool dump,
DumpMode dumpMode,
in Vec4i roi,
string debugText = null )
static

Displays a Texture image.

This method displays a Texture image.

The supported texture classes are Texture2D and RenderTexture. A new window will not be created if the number of image windows exceeds 50. Additionally, if a LayoutType is specified, please call the setup method to initialize before invoking the imshow method for the first time.

Parameters
winnameThe name of the window. If the same name is already added, it will be overwritten.
imgThe Texture to be displayed.
dumpSpecifies whether to dump the pixel data of the Texture. The pixel data will be reordered to match the format returned by the mat.dump() method, with the origin located at the top-right corner.
dumpModeSpecifies the dump mode (default is GetRawTextureDataMode). In GetRawTextureDataMode, if the TextureFormat is a compressed format, the raw byte data from the GetRawTextureData() method will be dumped as-is. Otherwise, the data will be reordered and dumped as pixel data with the origin in the top-right corner. In GetTexture32Mode, the Color32 array obtained via the GetPixels32() method will be reordered and dumped as pixel data with the origin in the top-right corner. If RenderTexture is specified for img, dumpMode is ignored and the data is always dumped in 4 channels per pixel.
roiThe part of the image to be displayed (extracts the intersecting area of img and roi).
debugTextThe debug text to be displayed in the InputField.

◆ imshow() [7/8]

static void OpenCVForUnity.UnityUtils.DebugMatUtils.imshow ( string winname,
Texture img,
bool dump,
DumpMode dumpMode,
in(int x, int y, int width, int height) roi,
string debugText = null )
static

Displays a Texture image.

This method displays a Texture image.

The supported texture classes are Texture2D and RenderTexture. A new window will not be created if the number of image windows exceeds 50. Additionally, if a LayoutType is specified, please call the setup method to initialize before invoking the imshow method for the first time.

Parameters
winnameThe name of the window. If the same name is already added, it will be overwritten.
imgThe Texture to be displayed.
dumpSpecifies whether to dump the pixel data of the Texture. The pixel data will be reordered to match the format returned by the mat.dump() method, with the origin located at the top-right corner.
dumpModeSpecifies the dump mode (default is GetRawTextureDataMode). In GetRawTextureDataMode, if the TextureFormat is a compressed format, the raw byte data from the GetRawTextureData() method will be dumped as-is. Otherwise, the data will be reordered and dumped as pixel data with the origin in the top-right corner. In GetTexture32Mode, the Color32 array obtained via the GetPixels32() method will be reordered and dumped as pixel data with the origin in the top-right corner. If RenderTexture is specified for img, dumpMode is ignored and the data is always dumped in 4 channels per pixel.
roiThe part of the image to be displayed (extracts the intersecting area of img and roi).
debugTextThe debug text to be displayed in the InputField.

◆ imshow() [8/8]

static void OpenCVForUnity.UnityUtils.DebugMatUtils.imshow ( string winname,
Texture img,
bool dump = false,
DumpMode dumpMode = DumpMode::GetRawTextureDataMode,
CoreModule.Rect roi = null,
string debugText = null )
static

Displays a Texture image.

This method displays a Texture image.

The supported texture classes are Texture2D and RenderTexture. A new window will not be created if the number of image windows exceeds 50. Additionally, if a LayoutType is specified, please call the setup method to initialize before invoking the imshow method for the first time.

Parameters
winnameThe name of the window. If the same name is already added, it will be overwritten.
imgThe Texture to be displayed.
dumpSpecifies whether to dump the pixel data of the Texture. The pixel data will be reordered to match the format returned by the mat.dump() method, with the origin located at the top-right corner.
dumpModeSpecifies the dump mode (default is GetRawTextureDataMode). In GetRawTextureDataMode, if the TextureFormat is a compressed format, the raw byte data from the GetRawTextureData() method will be dumped as-is. Otherwise, the data will be reordered and dumped as pixel data with the origin in the top-right corner. In GetTexture32Mode, the Color32 array obtained via the GetPixels32() method will be reordered and dumped as pixel data with the origin in the top-right corner. If RenderTexture is specified for img, dumpMode is ignored and the data is always dumped in 4 channels per pixel.
roiThe part of the image to be displayed (extracts the intersecting area of img and roi).
debugTextThe debug text to be displayed in the InputField.

◆ setup()

static void OpenCVForUnity.UnityUtils.DebugMatUtils.setup ( LayoutType type = LayoutType::RIGHT)
static

Sets up the DebugMatUtils GameObject.

The setup method adds DebugMatUtils-related GameObjects to the hierarchy. By calling this method, the initialization process that normally occurs when the imshow() method is called for the first time can be performed in advance.

Parameters
typeThe layout type for the setup.

The documentation for this class was generated from the following file: