| OpenCV index |
||||||||||
| Name | threshold ( ) | |||||||||
| Examples | import hypermedia.video.*;
OpenCV opencv;
void setup() {
size( 640, 240 );
// open video stream
opencv = new OpenCV( this );
opencv.capture( 320, 240 );
}
void draw() {
// grab frame from camera
opencv.read();
// filtering out pixels > 80 to 255
opencv.threshold(80);
image( opencv.image(), 0, 0 );
// filtering out pixels > 80 to 128
opencv.threshold(80, 128, OpenCV.THRESH_BINARY);
image( opencv.image(), 320, 0 );
}
|
|||||||||
| Description | Applies fixed-level threshold to the current image.
This method applies fixed-level thresholding to single-channel array. It is typically used to get bi-level (binary) image out of grayscale image or for removing a noise ( filtering out pixels with too small or too large values). About types of thresholding
|
|||||||||
| Syntax | threshold(value, max, type); threshold(value); |
|||||||||
| Parameters |
|
|||||||||
| Returns | float | |||||||||
| Usage | Web & Application | |||||||||
| Related | ||||||||||