jsfeat icon indicating copy to clipboard operation
jsfeat copied to clipboard

Gaussian pyramid down supported by jsfeat?

Open 452 opened this issue 12 years ago • 3 comments

Hello, how I can configure jsfeat to get "Gaussian pyramid down"? Gaussian pyramid down supported by jsfeat?

jsfeat.imgproc.gaussian_blur(source:matrix_t, dest:matrix_t, kernel_size, sigma = 0);
jsfeat.imgproc.pyrdown(source:matrix_t, dest:matrix_t);

=-=-=-=-=-=-=-= void org.opencv.imgproc.Imgproc.pyrDown(Mat src, Mat dst) Blurs an image and downsamples it. The function performs the downsampling step of the Gaussian pyramid construction. First, it convolves the source image with the kernel: 1/256 1 4 6 4 1 4 16 24 16 4 6 24 36 24 6 4 16 24 16 4 1 4 6 4 1 Then, it downsamples the image by rejecting even rows and columns. =-=-=-=-=-=-=-=

int BLUR_LEVEL = 4;
for (int i = 0; i < BLUR_LEVEL; i++) {
    Imgproc.pyrDown(blurred, blurred);
}

=-=-=-=-=-=-=-= but better will be for jsfeat:

    jsfeat.imgproc.pyrdown(source:matrix_t, dest:matrix_t, level);

452 avatar Oct 01 '13 08:10 452

for performance reasons jsfeat uses simple average of 4 pixels during pyr_down. if u are interested in very precise resizing during down sampling u can use jsfeat resize function.

inspirit avatar Oct 01 '13 09:10 inspirit

Resize down This step applies a spatial filter by calculating a level of the Gaussian pyramid. This is achieved by looping to the desired level where the input to the next loop is the result from the previous loop, starting with the original frame. A Gaussian pyramid level is calculated by, first, convolving the input frame with the kernel: K = 1/256 1 4 6 4 1 4 16 24 16 4 6 24 36 24 6 4 16 24 16 4 1 4 6 4 1 and then, downsampling the frame by rejecting even rows and columns. I can do this with jsfeat? yes or no. Be very awesome if you can create a small example.

452 avatar Oct 01 '13 11:10 452

there is no such method available at the moment. but u can always write/add/port it in ;)

inspirit avatar Oct 01 '13 11:10 inspirit