| Cv2SelectROI Method (String, InputArray, Boolean, Boolean) |
Selects ROI on the given image.
Function creates a window and allows user to select a ROI using mouse.
Controls: use `space` or `enter` to finish selection, use key `c` to cancel selection (function will return the zero cv::Rect).
Namespace:
OpenCvSharp
Assembly:
OpenCvSharp (in OpenCvSharp.dll) Version: 1.0.0
Syntax public static Rect SelectROI(
string windowName,
InputArray img,
bool showCrosshair = true,
bool fromCenter = false
)
Public Shared Function SelectROI (
windowName As String,
img As InputArray,
Optional showCrosshair As Boolean = true,
Optional fromCenter As Boolean = false
) As Rect
public:
static Rect SelectROI(
String^ windowName,
InputArray^ img,
bool showCrosshair = true,
bool fromCenter = false
)
static member SelectROI :
windowName : string *
img : InputArray *
?showCrosshair : bool *
?fromCenter : bool
(* Defaults:
let _showCrosshair = defaultArg showCrosshair true
let _fromCenter = defaultArg fromCenter false
*)
-> Rect
Parameters
- windowName
- Type: SystemString
name of the window where selection process will be shown. - img
- Type: OpenCvSharpInputArray
image to select a ROI. - showCrosshair (Optional)
- Type: SystemBoolean
if true crosshair of selection rectangle will be shown. - fromCenter (Optional)
- Type: SystemBoolean
if true center of selection will match initial mouse position. In opposite case a corner of
selection rectangle will correspond to the initial mouse position.
Return Value
Type:
Rectselected ROI or empty rect if selection canceled.
See Also