Method SelectROI
- Namespace
- OpenCvSharp
- Assembly
- OpenCvSharp.dll
SelectROI(string, InputArray, bool, bool)
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).
public static Rect SelectROI(string windowName, InputArray img, bool showCrosshair = true, bool fromCenter = false)
Parameters
windowNamestringname of the window where selection process will be shown.
imgInputArrayimage to select a ROI.
showCrosshairboolif true crosshair of selection rectangle will be shown.
fromCenterboolif true center of selection will match initial mouse position. In opposite case a corner of selection rectangle will correspond to the initial mouse position.
Returns
- Rect
selected ROI or empty rect if selection canceled.
SelectROI(InputArray, bool, bool)
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).
public static Rect SelectROI(InputArray img, bool showCrosshair = true, bool fromCenter = false)
Parameters
imgInputArrayimage to select a ROI.
showCrosshairboolif true crosshair of selection rectangle will be shown.
fromCenterboolif true center of selection will match initial mouse position. In opposite case a corner of selection rectangle will correspond to the initial mouse position.
Returns
- Rect
selected ROI or empty rect if selection canceled.