Very large image resize (> 32000 pixel)
Very large image resize (> 32000 pixel)
I need to perform fast smooth resizing on images much wider than 32000 pixels (actual ResizeImage() limit). Is there an easy way or should I write my own assembly routine?
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: Very large image resize (> 32000 pixel)
You probably do need to write your own routine - not necessarily ASM.
Discussions:
http://www.purebasic.fr/english/viewtop ... 88&start=0
http://www.purebasic.fr/english/viewtop ... =4&t=56736
Microsoft API:
http://www.microsoft.com/office/perceptivepixel/
Discussions:
http://www.purebasic.fr/english/viewtop ... 88&start=0
http://www.purebasic.fr/english/viewtop ... =4&t=56736
Microsoft API:
http://www.microsoft.com/office/perceptivepixel/
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
Re: Very large image resize (> 32000 pixel)
Hi technopol,
I've been working on an OpenCV wrapper, and one of the available functions is cvResize (image)... I just added a new example with this function included, testing an image size of 16000 x 16000 (the largest I could find), it seemed to work fairly quickly; not sure if it will meet your requirements though.
Also the wrapper requires third party DLL's which may not be an option for you, but if you're still interested I will send you a link.
Cheers!
I've been working on an OpenCV wrapper, and one of the available functions is cvResize (image)... I just added a new example with this function included, testing an image size of 16000 x 16000 (the largest I could find), it seemed to work fairly quickly; not sure if it will meet your requirements though.
Also the wrapper requires third party DLL's which may not be an option for you, but if you're still interested I will send you a link.
Cheers!
If you're not investing in yourself, you're falling behind.
My PureBasic Stuff ➤ FREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
Re: Very large image resize (> 32000 pixel)
Thanks IdeasVacuum;
now I understand it is just a manner of old 32-bit code not yet converted to 64-bit.
Just too bad the size limiting is done only for each dimension separately, instead of limiting the size of the image based on actual memory size used. Since the image I need to resize is very large in one dimension but very short in the other, it would surely fit very easily inside a 32-bit world.
JHPJHP,
a wrapper for OpenCV is more than welcome! I was about to use it in the same application and a simple way to address their libraries would accelerate my job a lot. Reading their examples in C and VB gives me headaches; even though I've already done VB.
Have you done, or planed to wrap the image acquisition part of OpenCV?
Tell me where I can buy this jewel.
now I understand it is just a manner of old 32-bit code not yet converted to 64-bit.
Just too bad the size limiting is done only for each dimension separately, instead of limiting the size of the image based on actual memory size used. Since the image I need to resize is very large in one dimension but very short in the other, it would surely fit very easily inside a 32-bit world.
JHPJHP,
a wrapper for OpenCV is more than welcome! I was about to use it in the same application and a simple way to address their libraries would accelerate my job a lot. Reading their examples in C and VB gives me headaches; even though I've already done VB.
Have you done, or planed to wrap the image acquisition part of OpenCV?
Tell me where I can buy this jewel.
Re: Very large image resize (> 32000 pixel)
- you're telling me... it took awhile to figure out some of the syntax as it didn't always match the documentationReading their examples in C and VB gives me headaches
Let me know if you have any questions; feedback is appreciated.
- 18 examples (cv_* uses OpenCV window - includes context menu, pb_* embedded OpenCV in PureBasic window)
- x86 binaries included (OpenCV & M$ Runtime)
- should be working on Vista and above (tested: Windows 7 64bit)
Update
- added cvResize to most of the examples because very large images caused an application crash
Cheers!
If you're not investing in yourself, you're falling behind.
My PureBasic Stuff ➤ FREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
Re: Very large image resize (> 32000 pixel)
I got the files, thanks a lot!
My application is currently written in 64-bit, on a Windows 8 machine; but I don't think it might cause problem, right?
My application is currently written in 64-bit, on a Windows 8 machine; but I don't think it might cause problem, right?
Re: Very large image resize (> 32000 pixel)
Hi technopol,
If you're using the PureBasic 64-bit IDE, then the 64-bit binaries from OpenCV are required.
JHPJHP
If you're using the PureBasic 64-bit IDE, then the 64-bit binaries from OpenCV are required.
JHPJHP
Last edited by JHPJHP on Fri Nov 22, 2013 3:44 pm, edited 2 times in total.
If you're not investing in yourself, you're falling behind.
My PureBasic Stuff ➤ FREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
Re: Very large image resize (> 32000 pixel)
Updated the package (now located in the Tricks 'n' Tips forum)
- includes the latest binaries from OpenCV v2.4.7 (x86 / x64)
-- still some issues to work out with x64
- http://www.purebasic.fr/english/viewtop ... 40&t=57457
JHPJHP
- includes the latest binaries from OpenCV v2.4.7 (x86 / x64)
-- still some issues to work out with x64
- http://www.purebasic.fr/english/viewtop ... 40&t=57457
JHPJHP
Last edited by JHPJHP on Fri Nov 22, 2013 3:48 pm, edited 7 times in total.
If you're not investing in yourself, you're falling behind.
My PureBasic Stuff ➤ FREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
Re: Very large image resize (> 32000 pixel)
JHPJHP, thank you for your work and examples!
Please, start new "OpenCV" topic in Tricks 'n' Tips.
Regards!
Please, start new "OpenCV" topic in Tricks 'n' Tips.
Regards!
Re: Very large image resize (> 32000 pixel)
I'm not very deeply involved in this topic, but just an idea...
Why not breaking down the huge image into several tiles (e.g. 32Kpixel x 32Kpixel), scaling the tiles down seperately and then put them together to a rezised destination image?
Maybe using overlaping bounds to prevent artefacts at the edges of the tiles.
Why not breaking down the huge image into several tiles (e.g. 32Kpixel x 32Kpixel), scaling the tiles down seperately and then put them together to a rezised destination image?
Maybe using overlaping bounds to prevent artefacts at the edges of the tiles.
PB 6.02 x64, OS: Win 7 Pro x64 & Win 11 x64, Desktopscaling: 125%, CPU: I7 6500, RAM: 16 GB, GPU: Intel Graphics HD 520, User age in 2024: 56y
"Happiness is a pet." | "Never run a changing system!"
"Happiness is a pet." | "Never run a changing system!"
Re: Very large image resize (> 32000 pixel)
All the routines I have tested doesn't provide the speed we need for our application (processing a few hundred GB at one point of the process, as fast as possible, so production process isn't too slow). I'll have to build a very optimized scaling routine using SIMD and process 10 RGB (or 32 grayscale) pixels at once.
The image processing I'm designing is new and its possible to greatly optimize the process for this specific application. If not fast enough, I'll have to go with GPU processing. Or I might be able to fit all data and code inside this thread's available L2 cache and/or split the process into parallel threads to achieve good production speed.
ASM is my world, I should have started there at first.
The image processing I'm designing is new and its possible to greatly optimize the process for this specific application. If not fast enough, I'll have to go with GPU processing. Or I might be able to fit all data and code inside this thread's available L2 cache and/or split the process into parallel threads to achieve good production speed.
ASM is my world, I should have started there at first.
