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
For performance reason, these accessors must be available in at least one of the following way :
Directly as a property on algorithm's classes (<= This one is the way that makes more sense but more time-consuming to develop)
Throught some static method in classes like "Features2DInvoke".
At least, as an exposed entry point in cvextern.dll so we (consumer of emgu library) can do P/Invoke onto this entry point (<= This one is the least time-consuming, since it requires only c++ side to be updated.)
Performance is critical here. These algorithms are compute intensive code which may be used in scenarios were an enduser experience will be reduced if we don't pay attention to micro-optimization.
To Reproduce
When we try to avoid new object creation/native memory structure initialization :
Emgu.CV.Features2D.FastFeatureDetector detector=new Emgu.CV.Features2D.FastFeatureDetector();for(intthreshold=0;threshold<64;threshold++){FileStoragestorage=new FileStorage("dontcare.json", FileStorage.Mode.FormatJson | FileStorage.Mode.Write | FileStorage.Mode.Read | FileStorage.Mode.Memory);//Must allocate inmemory file storage = time & memory consuming.
detector.Write(storage);//May expand underlying storage = even more time & memory lost.varrawConfig= storage.ReleaseAndGetString();//Releasing resources = time consuming.//Parse the rawConfig into Json object = time consuming.//Lookup for corresponding property for "threshold" parameter = time consuming.//Load back the new configuration into detector (JSON object => String serialization => FileStorage) = Even more time & memory lost.varkeypoints= detector.Detect(someImageHere);//...Detect features...if(keypoints.Length >= settings.MinimumKeyPointCountSetting){//Do some stuff when minimal keypoint count is met so we have better results in the remaining code here.}}
When we try to avoid all time & memory losses spent in some bytes<->string<->object<->string<->bytes conversions :
for(intthreshold=0;threshold<64;threshold++){
Emgu.CV.Features2D.FastFeatureDetector detector=new Emgu.CV.Features2D.FastFeatureDetector(threadhold: threshold);//Re-allocation of underlying native memory by calling one of the OpenCV's FAST initialization routine => Time & memory consuming.varkeypoints= detector.Detect(someImageHere);//...Detect features...if(keypoints.Length >= settings.MinimumKeyPointCountSetting){//Do some stuff when minimal keypoint count is met so we have better results in the remaining code here.}}
Expected behavior
Emgu.CV.Features2D.FastFeatureDetector detector=new Emgu.CV.Features2D.FastFeatureDetector();for(intthreshold=0;threshold<64;threshold++){
detector.Threshold =threshold;//Try at this threshold...It's the minimal time & memory losses solution => No memory (re)-allocation is done. The only remaining losses are related to P/Invoke or inner FAST implementation. Both of those can't be avoided.varkeypoints= detector.Detect(someImageHere);//...Detect features...if(keypoints.Length >= settings.MinimumKeyPointCountSetting){//Do some stuff when minimal keypoint count is met so we have better results in the remaining code here.}}
The text was updated successfully, but these errors were encountered:
Describe the feature
In OpenCV, when we look at Feature2D algorithms (like FAST (https://docs.opencv.org/3.4/df/d74/classcv_1_1FastFeatureDetector.html), ORB (https://docs.opencv.org/3.4/db/d95/classcv_1_1ORB.html) or LUCID (https://docs.opencv.org/4.x/d4/d86/classcv_1_1xfeatures2d_1_1LUCID.html)), there's a lot of get/set accessors (like getThreshold/setThreshold for FAST) which are not available at all throught EMGU.
For performance reason, these accessors must be available in at least one of the following way :
Performance is critical here. These algorithms are compute intensive code which may be used in scenarios were an enduser experience will be reduced if we don't pay attention to micro-optimization.
** OS / Platform **
All
** .Net version **
All
CPU Architecture
All
** Emgu CV package used**
Emgu.CV.runtime.windows-4.7.0.5276 nuget package from commercial repository.
To Reproduce
When we try to avoid new object creation/native memory structure initialization :
When we try to avoid all time & memory losses spent in some bytes<->string<->object<->string<->bytes conversions :
Expected behavior
The text was updated successfully, but these errors were encountered: