Undocumented
| Function | add |
Add Annotation to an image |
| Function | biggest |
Undocumented |
| Function | biggest |
Function to find the biggest contour in an binary image |
| Function | compress |
Compress OpenCV image |
| Function | concat |
Concat multiple images along 1 axis |
| Function | debug |
Display detected markers on an image |
| Function | debug |
Return masked image to see the effect of color threshold |
| Function | draw |
Draw a list of contour on an image and return the drawing image |
| Function | extract |
Take a ROS CompressedImage message and return the image uncompressed |
| Function | extract |
Extract working area from an image thanks to 4 Niryo's markers |
| Function | get |
Return orientation of a contour according to the smallest side in order to be well oriented for gripper |
| Function | get |
Return barycenter of an OpenCV Contour |
| Function | improve |
Improve binary mask with morphological operation |
| Function | morphological |
Take black & white image and apply morphological transformation |
| Function | relative |
Transform a pixels position to a relative position |
| Function | resize |
Resize an image. The user should precise only width or height if he wants to keep image's ratio |
| Function | show |
Display an image and check whether the user want to close |
| Function | show |
Display an image and wait that the user close it |
| Function | show |
Display an image during a certain time |
| Function | threshold |
Threshold hsv image of blue component :param img_hsv: hsv image to be threshold :type img_hsv: numpy.array :param blue_img: threshold img :rtype: numpy.array |
| Function | threshold |
Threshold hsv image of green component :param img_hsv: hsv image to be threshold :type img_hsv: numpy.array :param green_img: threshold img :rtype: numpy.array |
| Function | threshold |
Take BGR image (OpenCV imread result) and return thresholded image according to values on HSV (Hue, Saturation, Value) Pixel will worth 1 if a pixel has a value between min_v and max_v for all channels... |
| Function | threshold |
Threshold hsv image of red component :param img_hsv: hsv image to be threshold :type img_hsv: numpy.array :param red_img: threshold img :rtype: numpy.array |
| Function | uncompress |
Take a compressed img and return an OpenCV image |
| Function | undistort |
Use camera intrinsics to undistort raw image |
| Variable | keys |
Undocumented |
Add Annotation to an image
| Parameters | |
| img:numpy.array | Image |
| text:str | text string |
| write | if you write the text on top |
| Returns | |
| numpy.array | img with text written on it |
Function to find the biggest contour in an binary image
| Parameters | |
| img:numpy.array | Binary Image |
| nb | maximal number of contours which will be returned |
| Returns | |
| list[OpenCV Contour] | biggest contours found |
Compress OpenCV image
| Parameters | |
| img:numpy.array | OpenCV Image |
| quality:int | integer between 1 - 100. The higher it is, the less information will be lost, but the heavier the compressed image will be |
| Returns | |
| bool, str | status & string representing compressed image |
Concat multiple images along 1 axis
| Parameters | |
| tuple | tuple of images |
| axis:int | 0 means vertically and 1 means horizontally |
| Returns | |
| numpy.array | Concat image |
Display detected markers on an image
| Parameters | |
| img:numpy.array | OpenCV image which contain Niryo's markers |
| workspace | Ratio between the width and the height of the area represented by the markers |
| Returns | |
| numpy.array | (status, annotated image) |
Return masked image to see the effect of color threshold
| Parameters | |
| img:numpy.array | OpenCV image |
| color | Color used for debug |
| Returns | |
| numpy.array | Masked image |
Draw a list of contour on an image and return the drawing image
| Parameters | |
| img:numpy.array | Image |
| contours:list[OpenCV Contour] | contours list |
| Returns | |
| numpy.array | Image with drawing |
Take a ROS CompressedImage message and return the image uncompressed
| Parameters | |
| ros | a ROS CompressedImage |
| Returns | |
| numpy.array | image uncompressed |
Extract working area from an image thanks to 4 Niryo's markers
| Parameters | |
| img:numpy.array | OpenCV image which contain 4 Niryo's markers |
| workspace | Ratio between the width and the height of the area represented by the markers |
| Returns | |
| numpy.array | extracted and warped working area image |
Return orientation of a contour according to the smallest side in order to be well oriented for gripper
| Parameters | |
| contour:OpenCV Contour | contour |
| Returns | |
| float | Angle in radians |
Return barycenter of an OpenCV Contour
| Parameters | |
| contour:OpenCV Contour | |
| Returns | |
| int, int | Barycenter X, Barycenter Y |
Improve binary mask with morphological operation
| Parameters | |
| mask:numpy.array | input mask to improve |
| Returns | |
| numpy.array | mask improved |
Take black & white image and apply morphological transformation
| Parameters | |
| im | Black & White Image |
| morpho | CLOSE/OPEN/ERODE/DILATE => See on OpenCV/Google if you do not know these words |
| kernel | tuple corresponding to the size of the kernel |
| kernel | RECT/ELLIPSE/CROSS => see on OpenCV |
| Returns | |
| numpy.array | image after processing |
Transform a pixels position to a relative position
| Parameters | |
| img:numpy.array | Image where the object is detected |
| x | coordinate X |
| y | coordinate Y |
| Returns | |
| float, float | X relative, Y relative |
Resize an image. The user should precise only width or height if he wants to keep image's ratio
| Parameters | |
| img:numpy.array | OpenCV Image |
| width:int | Target Width |
| height:int | Target Height |
| inter:long | OpenCV interpolation flag |
| Returns | |
| numpy.array | resized image |
Display an image and check whether the user want to close
| Parameters | |
| window | window's name |
| img:numpy.array | Image |
| Returns | |
| bool | boolean indicating if the user wanted to leave |
Display an image and wait that the user close it
| Parameters | |
| window | window's name |
| img:numpy.array | Image |
| Returns | |
| None | None |
Display an image during a certain time
| Parameters | |
| window | window's name |
| img:numpy.array | Image |
| wait | Wait time in milliseconds |
| Returns | |
| int | value of the key pressed during the display |
Threshold hsv image of blue component :param img_hsv: hsv image to be threshold :type img_hsv: numpy.array :param blue_img: threshold img :rtype: numpy.array
Threshold hsv image of green component :param img_hsv: hsv image to be threshold :type img_hsv: numpy.array :param green_img: threshold img :rtype: numpy.array
Take BGR image (OpenCV imread result) and return thresholded image according to values on HSV (Hue, Saturation, Value) Pixel will worth 1 if a pixel has a value between min_v and max_v for all channels
| Parameters | |
| img:numpy.array | image BGR if rgb_space = False |
| color | Undocumented |
| Returns | |
| numpy.array | threshold image |
Threshold hsv image of red component :param img_hsv: hsv image to be threshold :type img_hsv: numpy.array :param red_img: threshold img :rtype: numpy.array
Take a compressed img and return an OpenCV image
| Parameters | |
| compressed | compressed image |
| Returns | |
| numpy.array | OpenCV image |