Name |
interpolation() |
Examples |
import hypermedia.video.*;
OpenCV opencv;
size( 120, 160 );
opencv = new OpenCV(this);
opencv.allocate(width,height); // create the bufer
opencv.copy("niolon.jpg"); // copy the image in its entirety into buffer
opencv.interpolation(OpenCV.INTER_NN); // set the interpolation method
opencv.copy("niolon.jpg",50,70,20,20,20,20,80,80); // copy a part of the image into buffer
image( opencv.image(), 0, 0 ); // show buffer
|
Description |
Set global interpolation method.
By default the interpolation method is set to INTER_LINEAR .
Used by all methods (ex. copy() , loadImage() , …) that resize the image.
- INTER_NN
- nearest-neighbor (preserve hard egdes)
- INTER_LINEAR
- bilinear interpolation
- INTER_CUBIC
- bicubic interpolation (best for smooth gradients)
- INTER_AREA
- resampling using pixel area relation
|
Syntax |
interpolation(method);
|
Parameters |
method |
int : INTER_NN, INTER_LINEAR, INTER_CUBIC or INTER_AREA |
|
Return |
None |
Usage |
Application |
Related |
|