2.15.11 cvroiprofile


Menu Information

Right-click on the ROI in the Image window, select Intensity Profile

Brief Information

Profiling image data on ROI

Command Line Usage

cvroiprofile -r 1 multi:=all trstats.n:=1 trstats.sum:=1;

Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
roi

Input/Output

String

0

The ROI added in the Image window.

Input Image imgi

Input

ImageLayer

<optional>

Specifies the input Image layer.

Profile on multi

Input

int

0

Specifies profiling on active ROI or all ROIs on Image.

Option list:

  • 0=active: Active ROI
    Profile on all ROIs on Image
  • 0=all: All ROIs on Image
    Profile on active ROI only
Data Layout layout

Input

int

0

Available when Profile on is set to All ROIs on Image. When there are more than one ROIs and/or multiple frames, it will generate multiple sets of statistics values. This option is used to specify the layout of the statistics values output to the result worksheet.

Option list:

  • 0=img: Image Rowwise
    Statistics values of each image frame will append by rows
  • 1=roi: ROI Rowwise
    Statistics values of each ROI will append by rows
Cvroiprofile layout.png
Statistics trstats

Input

TreeNode

<unassigned>

Specifies which quantity to be computed and output.

See more details in section below.

Weighted ROI weight

Input

int

0

This option is useful for tiny coordinates ROI. If this option is selected (weight = 1), each pixel is weighted by the area covered by ROI polygon. For example, if a pixel point on the edge of ROI box is half inside ROI and the other half outside ROI, its weight is 0.5. On the other hand, a pixel point at the censter of ROI box will count weight as 1.

RGB Profile rgb

Input

int

0

When import colorful image, this option supports generating the intensity profile result base on RGB value of each pixel: 0=false, 1=true.


Then use sort variable to control how to sort the output columns.

Sort Output Columns by sort

Input

int

0

Available when RGB Profile checkbox is checked. Specifies how to sort the output columns.

Option list:

  • 0=stats:Statistics
    Sort the output columns by statistics values first, within each statistics value sort by RGB color.
  • 1=rgb:RGB
    Sort by RGB first, within each color sort by different Statistics.
Output rd

Output

ReportData

[<new>]

Specifies the output Worksheet.

Description

This X-Function cvroiprofile is used to profile on ROI and generate a new worksheet to output descriptive statistics values. Refer to this document page for more information.

trstats

The trstats tree specifies the descriptive statistics values to be output from cvroiprofile X-Function: 0=false, 1=true.

Syntax: trstats.Treenode:=<value>

Example:

  • trstats.n:=1
  • trstats.sum:=1
Treenode Label Type Default Description
mean Mean int 1 Mean value
sd SD int 0 Standard deviation value
n N int 0 The number of the data points covered by ROI box
min Min int 0 Minimum value inside ROI box
max Max int 0 Maximum value inside ROI box
median Median int 0 Median value inside ROI box
sum Sum int 0 Sum value
mincoord XY of Min int 0 XY coordinates of the minimum value inside ROI
maxcoord XY of Max int 0 XY coordinates of the maximum value inside ROI

Related X-Functions

mroiprofile