-
Notifications
You must be signed in to change notification settings - Fork 211
Description
(cross posting from nenadmarkus/picojs#33, since this has more to do with the underlying implementation, and less to do with the javascript framework)
Hi, I want to use pico to find faces on images of arbitrary width/height. I am hoping there is some sort of general rule I can uses for setting the ldim parameter based on image width & height. I have read over the explanation doc https://nenadmarkus.com/p/picojs-intro/
The parameter ldim tells us how to move from one row of the image to the next (known as stride in some other libraries, such as OpenCV).
From what I gather from the examples, it is usually set to the ncols parameter (a.k.a image width). However, I have an example image that is 400x400 pixels. Setting these params:
// where image.width === 400 and image.height === 400
const image = {
pixels: rgba_to_grayscale(image_data, image_data.height, image_data.width),
nrows: image_data.height,
ncols: image_data.width,
ldim: image_data.width
}This results in zero detections. Setting ldim to the seemingly arbitrary value of 419 results in one detection (which is the desired result). Setting ldim to anything higher results in several detections all correspoding to the same face.
All the other parameters have values taken from examples/image.html
ldim: 400 (the image width):

ldim: 419 (the desired result):

ldim: 420:

ldim: 480:
