Open bherbruck opened 4 years ago
I want this function too, but it seems the dvp lib leaves this as //to do in the source code. I use img.resize(224,224) instead.
I haven't been able to get img.resize() working and can't find any documentation for it although it is in py_image.c. I'm also using this for yolo2 and I think sensor.set_windowing also does something with dvp_set_ai_addr() which may affect yolo2. I have no clue though.
It seems that yolo2 or mobilenet both refer to dvp_set_ai_addr() and the pix_ai data of the image itself. What I am in need is to resize an image from QVGA to (224,224) for yolo2 or mobilenet by using resize(). Although resize() works fine but the ai data lost after resizing. So I make a #198 pull request to make this happen. I hope it can be accepted so. So we can just use image.resize(224,224) without using something like set_windowing(50,224,224) for kpu task.
gc0328 has supported, commit here : a3fc950007dffde5fccef65499181e65c18c1ff7 but other sensors need to implement
and pay attention, the width or height must multiple of 8 bytes
sensor.set_windowing()
does not center when no x, y coords are given, also does not move window to x, y coords. Same image is returned:sensor.set_windowing((50, 0, 224, 224))
sensor.set_windowing((0, 0, 224, 224))
This causes image distortion huge problems with wide angle lenses.I believe the issue is with the dvp libraries, the image just crops to the top-left corner instead of centering.