You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The execution time between the moment the camera captures an image and when that image gets classified can be reduced by eliminating the number of times an image is being written to file and the read back into memory.
Current Process
Image acquisition is trigger by executing the ims100_testapp binary which outputs a raw image file (ims_rgb) and a png file.
The png file is read, downsampled, and converted to a thumbnails jpeg file with the following piped Netpbm programs outputs: pngtopam {F} | pamscale {S} | pnmtojpeg -quality {Q} > {O}.
The png file is read, downsampled, and converted to an image classification input file with the following piped Netpbm programs outputs: pngtopam {F} | pamscale -xsize {X} -ysize {Y} | pnmtojpeg -quality {Q} > {O}.
The image classification input file is read by the image classifier binary executable and then classified.
Delete the image classification input file created in step 3.
Optimization
Option A – Full Optimization:
Integrate image acquisition and classification into a single binary that processes the image file in a memory buffer and only writes the ims_rgb, png, and thumbnail jpeg file at the very end when classification is complete.
Implement a threadpool / queue to classify the image as soon as the camera is done writing the image data in memory so that the camera is not blocked waiting for the image processing and classification process to be completed before it can start capturing the next picture.
Option B – Partial Optimization (In-Memory):
Get rid of steps 2 and 3 in the current process and replace them with in-memory image processing within the image classifier.
Option C – Partial Optimization (File writing):
Get rid of steps 2 and 3 in the current process and replace them with a custom dedicated executable binary.
There's ongoing work for Option C. Here's the custom dedicated executable binary to replace the SmartCam's dependency on piped Netpbm program outputs: https://github.com/georgeslabreche/image-resizer
Background
The execution time between the moment the camera captures an image and when that image gets classified can be reduced by eliminating the number of times an image is being written to file and the read back into memory.
Current Process
ims100_testapp
binary which outputs a raw image file (ims_rgb) and a png file.pngtopam {F} | pamscale {S} | pnmtojpeg -quality {Q} > {O}
.pngtopam {F} | pamscale -xsize {X} -ysize {Y} | pnmtojpeg -quality {Q} > {O}
.Optimization
Option A – Full Optimization:
Option B – Partial Optimization (In-Memory):
Get rid of steps 2 and 3 in the current process and replace them with in-memory image processing within the image classifier.
Option C – Partial Optimization (File writing):
Get rid of steps 2 and 3 in the current process and replace them with a custom dedicated executable binary.
Resources
Use the stb headers to process images in-memory:
The text was updated successfully, but these errors were encountered: