-
Notifications
You must be signed in to change notification settings - Fork 31
op minAreaRect
Compute minimum area RotatedRect for a range of pixel intensity values in a selected image channel. This FireSight operation relies on OpenCV minAreaRect.
-
min Default value is
1. Minimum pixel value to consider. -
max Default value is
255. Maximum pixel value to consider. -
channel Default value is
0. Index of BGR image channel.
The minAreaRect operation is actually a fast single blob detector, and provides a single RotatedRect in the model using the JSON structure expected by op drawRects. The number of points in the RotatedRect region is also given so you can compute region density.
{
"rects":[
{
"x":62.514705657958984,
"y":127.30883026123047,
"width":43.560646057128906,
"height":27.268278121948242,
"angle":-59.036239624023438
}
],
"points":792
}
Example 1: Find bright green things pipeline
firesight -i img/abc-color.png -p json/minAreaRect.json -o target/minAreaRect.png -Dmin=128 -Dchannel=1 -Dthickness=1
Consider a colorful picture:

We can find and box all bright green things using channel=1 and min=128:

Example 2: Detect a part pipeline
firesight -i img/part1-0.png -p json/minAreaRect-thresh.json -o target/minAreaRect-thresh.png
Suppose we have a pick-and-place head with no part:

We then pick up a part:

Using op absdiff we get:

Starting with the absdiff'ed image, the pipeline uses op threshold to generate this image with Otsu's method:

Finally, the minAreaRect stage itself gives us:
