ihhub / penguinv Goto Github PK
View Code? Open in Web Editor NEWComputer vision library with focus on heterogeneous systems
License: Other
Computer vision library with focus on heterogeneous systems
License: Other
Does template matching code need to be complicated? How many methods we need to cover? Do we need to use FFT for all of methods?
Speed up blob detection for the part of map creation before finding any blobs. How fast it could be? How to make it code friendly without changing a lot of structure?
Nowadays many systems contain multiple GPU so it would be good to have a multi GPU support.
The library has been developed for Raspberry Pi we need some code for camera support or 3rd part library as an example code.
Using command line is inconvenient when project contains a lot of file plus end user doesn't like to do extra moves to copy, paste, run and etc.
As a project evolves it is important to make it recognizable.
It would be great if someone helps us with logo for our project.
They are common used functions. One of solution is to use FFT.
It is image processing library so people would like to see examples with GUI. Need simple resizing window able to draw an image [gray-scale and/or color] and simple drawings for following systems:
Example code must be as easy as possible and at the same time it is good to have an option to build without framework or specific tools (not everyone has QT for example).
Example code should follow structure: load image from drive --> show --> wait for user response --> do something on image --> show image
This is simple structure how gui object (window) could look like:
class GuiWindow
{
public:
GuiWindow(const std::string & caption) { };
virtual ~GuiWindow() { };
virtual void show() = 0;
virtual void resize( uint32_t width, uint32_t height ) = 0; // resize window
virtual void draw( const Bitmap_Image::Image & image ) = 0; // draw an image
virtual void wait(uint32_t timeMs) = 0; // wait for event. If time is not 0 then wait for specified time
// otherwise any user response such as mouse click or key press
private:
std::string _caption;
};
Currently we fix support only to RGBA images while there are different types of images. Plus we allocate memory twice for image loading what we actually have to do only once.
To simplify developer's life it would be useful to investigate the possibility of installation library within OS so it would be stored in one place.
It is important to have some real numbers showing the difference in some technologies utilization. Plus it is good tool to verify quality of code implementation: compare expected speed with real.
SIMD instructions on ARM are very similar to SSE/AVX. It would be great to have such support. The structure of functions could be gotten from SSE namespace.
Of course it is necessary to have unit tests for such functions.
How would it be easier for user to compiler the library? Do we need to use CMake but this is extra moves? Do we need to give just an instruction for projects? What to do with 3-rd parties libraries?
As the library is cross-platform it would be great to have an example project for Android system.
It would be useful to add examples for each (or multiple) filter to show what they do and which results they give.
Currently we don't have any example of CUDA usage within the library. It would be very good to show capacity of the library.
It is well-known problem and there are multiple solutions for this. Now the library just copies a part of image which is close to borders. Proper way is to apply median filter on borders too but might be with smaller size or center-shifted.
We need a code what checks which CPU architecture it is compiled on, plus all possible supported instructions sets such as SSE, AVX, NEON. Please refer to folder PenguinV/Library/penguinv for more information.
cpu_identification.h file should contain all necessary checks inside by right logic. Now it is empty :(
The idea is once compiled application/library could choose possible supported instruction sets and utilize it without extra magic. First step is to identify CPU architecture on what is compiled. This could be done by macros. Second step is verification supported instruction sets on current platform/architecture.
It looks weird but it could be useful in situations as:
1. Width of image ROI (region of interest) is less than 16 but more than 7. So MMX will be faster than normal code.
2. Old CPU support
Please refer to cpp image_function_sse.h
and cpp image_function_sse.cpp
for example how to make a proper code. At the beginning it is enough to have Bitwise And, Or and Xor functions.
Some basic functions could be done with SSE/AVX. This is a short list of them:
ConvertToGrayScale
ConvertToRgb
Sum
ProjectionProfile
RgbToBgr
FFT is must be thing for image processing. At the same time does FFTW have proper licence for this project?
Are there any plans to add OpenCL enhancements for operations that are easy to parallelise and would benefit from GPU support (such as gaussian blurs)?.
On OSX, after cloning the library, and trying to run the unit tests, it fails to compile:
$ g++ -std=c++11 -Wall unit_tests.cpp ../Library/image_function.cpp unit_test_framework.cpp unit_test_helper.cpp unit_test_image_buffer.cpp unit_test_image_function.cpp -o application
In file included from unit_test_helper.cpp:1:
./unit_test_helper.h:70:30: error: use of undeclared identifier 'rand'
return static_cast<data>( rand() ) % maximum;
^
./unit_test_helper.h:80:36: error: use of undeclared identifier 'rand'
data value = static_cast<data>( rand() ) % maximum;
^
2 errors generated.
In file included from unit_test_image_buffer.cpp:2:
./unit_test_helper.h:70:30: error: use of undeclared identifier 'rand'
return static_cast<data>( rand() ) % maximum;
^
./unit_test_helper.h:80:36: error: use of undeclared identifier 'rand'
data value = static_cast<data>( rand() ) % maximum;
^
unit_test_image_buffer.cpp:278:25: error: use of undeclared identifier 'rand'
uint8_t fakeValue = rand() % 2;
^
3 errors generated.
In file included from unit_test_image_function.cpp:3:
./unit_test_helper.h:70:30: error: use of undeclared identifier 'rand'
return static_cast<data>( rand() ) % maximum;
^
./unit_test_helper.h:80:36: error: use of undeclared identifier 'rand'
data value = static_cast<data>( rand() ) % maximum;
^
2 errors generated.
Memory pool is very useful in situations when RAM is not so fast and memory allocation/deallocation takes time. At the same time memory allocator requires some time to execute the code for allocation/deallocation while memory pool is ~O(1) speed because it contains fixed size of data chunks. Evolution of memory pool and memory allocation could give a good results in performance.
We have libpng support but not libjpeg. Many images are stored in this format and it would be irrational to do not support it.
Correlates with #7
Some basic functions could be done with multithreading. Some of them are:
Flip
Transpose
ConvertToGrayScale
ConvertToRgb
ExtractChannel
IsEqual
GammaCorrection
Resize
Accumulate
Bitmap_Image namespace name confuses some people because by logic it is not a bitmap image itself. Remove default 4 pixel alignment of rows .
Current code is bulky and it is not obvious as it should be.
Ideally the code must look like this:
Image image = loadBitmap("someplace.bmp");
But there is no guarantee that loaded image is gray-scale. So the code should be at least like this:
TemplateImage<uint8_t> image = loadBitmap("someplace.bmp");
But then how to convert to normal BitmapImage standard without branching code?
Currently all code for CUDA based on default stream and this could be downgrade in performance.
Looking at values from performance tests some people couldn't understand while seeing a fancy graph is more likely to understand of performance. We need some file output for another third-party software to show results in more user-friendly way.
It is required to add a makefile for performance tests (see performance_tests) folder to support make. Please refer to makefile structure for examples.
Not all basic functions are covered by unit tests so it is must to have it.
It is very difficult to create correct unit tests for some of functions. This is a list of functions which currently do not have unit tests:
GetThreshold
SetPixel
Flip
Convert
Fill
Histogram
IsEqual
Normalize
Resize
ProjectionProfile
Transpose
We need to have a proper way to calculate optimum number of threads and blocks for device functions. Please take a look at Library/cuda/image_function_cuda.cu function void getKernelParameters(int & threadsPerBlock, int & blocksPerGrid, uint32_t size)
.
Need to add CUDA OS independent code at least for some basic functions. Many PCs contain NVidia videocards so it is not rational to do not support such thing as CUDA. At the same time it would be better to have an example code/project.
Please remember: the code must be as simple as possible with proper comments :)
Windows doesn't have third-party support of libpng (and zlib). We need to do a nice code which would be easy to use
Correlates with #7
No need to convert gaussian filter from original domain into frequency domain because we could calculate it directly in frequency domain.
Currently the code supports only Gray and RGB images while we've introduced RGBA type as well. We have to have support for RGBA images as well.
The solution is just ignore alpha channel in image because it is for representation of image.
Blob detection is one of slowest operations in image processing. Doing blob detection in parallel is not so obvious task as it requires additional step: merging results. I have one implementation of blob detection in parallel but need some overview of implementation. I will add the code soon.
We use only one dimension in CUDA kernels to execute operations on image but according CUDA specification for devices lower than 3.0 computation version maximum resolution per X axis is only 65535. We use 256 threads per block so it makes our image limit to 16,776,960 bytes or around 16 MB.
Our unit test maximum resolution is only 2048 by 2048 pixels which is less than 16 MB so unit tests do not fail for us.
As described in library's description we do not support multiple standards of images but would be good to have an example of 3rd party library for different formats of images.
We have a support of different types of images but for each type we have it's own namespace which is inconvenient for user. We need to have a namespace wrapper which will do image saving/loading based on image type.
Add Travis CI (https://travis-ci.org) auto build for whole project. Do not put all files in root directory because it makes file structure messy. Put all needed files into travis_auto_build
directory which would locate in root of project.
The project is already activated on Travis CI and the build status indicator is added too.
Pinned memory is much faster for data copying between CPU and GPU. Extra enhancement is needed.
Colour space conversion is very useful for many situations. Not all devices grab images only in RGB or display them.
Need some algorithms for edge detection. Simple ones are first-order detectors, like Canny for example.
As a library the project should be built as a static library as well. We must add necessary project/make files for this.
From design point of view it's a good practice to put project/make files out of main PenguinV\Library
directory. Recommended path for this is PenguinV\build\static_library
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.