Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
1e4d1df
[popsift] choosing a runtime between two descriptor printing mode
Oct 5, 2020
fa695d6
[bugfix] vlfeat compliance in orientation computation
Oct 5, 2020
608eac5
Merge branch 'develop' into fix/misalignBugOri
Oct 5, 2020
0b8fb18
[demo] print default values in usage
Oct 5, 2020
92f1846
[bug] corrected truncating in L2 normalization
Oct 5, 2020
a529cad
[bug] added reverse square root required by previous bugfix
Oct 5, 2020
a9ca694
[feature] VLFeat-compliant descriptor extraction
Oct 5, 2020
003e7ea
[popsift] cleanup
Oct 5, 2020
52c3cbe
[popsift] first parallelism in vlfeat descriptors
Oct 5, 2020
5c0256f
[bugfix] limit accepted orientations to histogram entries 0.8*max again
Oct 5, 2020
bf59959
[popsift] use 32 threads for each descriptor
Oct 5, 2020
d93b8e3
[popsift] commented extended option
Oct 6, 2020
9349547
[popsift] avoid a conflict between old and vlfeat orientation computa…
Oct 6, 2020
942aea1
[cleanup] remove histogram smoothing mode that was never used
Oct 6, 2020
aea885e
[cleanup] remove unused code
Oct 6, 2020
b7bbcd2
[popsift] move rotation compensation to descriptor extraction
Oct 6, 2020
b3f8434
Merge branch 'develop' into fix/vlfeatCompliance
Oct 7, 2020
e9ec403
[popsift] choose between orientation computation modes
Oct 7, 2020
cbf70d0
[bugfix] fix half-bin shift in Interpolated mode
Oct 7, 2020
2708e89
[popsift] minor range modification in orientation computation
Oct 8, 2020
bbc0e75
[doc] improved doc for enum DescMode
Oct 8, 2020
1ea511e
[doc] moved the Usage for the DescMode parameter to sift_conf.cu
Oct 8, 2020
6eeaee3
[doc] Integrating Config defaults into the Usage.
griwodz Oct 8, 2020
e370180
[popsift] added Config::getSigma()
Oct 8, 2020
5591c5b
[popsift] rotate orientation by 180deg in all older modes
Oct 10, 2020
6faa3f4
[test] draft comparison code
Oct 10, 2020
3cdc329
[popsift] remove circular limitation for descriptor in VLFeat mode
Oct 11, 2020
59a70c0
[popsift] avoid boost in libpopsift
Oct 11, 2020
1a54748
[test] updating descriptor file comparison
Oct 11, 2020
085694b
[testing] remove test file, prioritize main PR
Oct 11, 2020
3673a85
[popsift] shorter replace strcmp with string::op==
griwodz Oct 12, 2020
bd1c8ef
[popsift] add more Config::get* functions, improve usage
Oct 12, 2020
74f7053
[popsift] remove failed interpolating orientation code
Oct 16, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 22 additions & 9 deletions src/popsift/sift_conf.cu
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,25 @@
#include "common/debug_macros.h"
#include "sift_conf.h"

#include <boost/algorithm/string.hpp>

#include <iostream>
#include <algorithm>

using namespace std;

static bool stringIsame( string l, string r )
{
std::for_each( l.begin(), l.end(), [](char& c) { c = ::tolower(c); });
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
std::for_each( l.begin(), l.end(), [](char& c) { c = ::tolower(c); });
// early exit
if(l.size() != r.size())
{
return false;
}
std::for_each( l.begin(), l.end(), [](char& c) { c = ::tolower(c); });

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I take the proposed change. I wanted to go for strncmp, but Windows does apparently not have it, it has stricmp. And adding Boost just for this seemed like too much.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@simogasp It would be really preferable to use strcasecmp() for non-Windows and _stricmp() for Windows. The first requires inclusion of strings.h (at least on Linux and Mac) and the other string.h. The first one is a function, the second is a macro. I'm too stupid to write a CMake test, so I gave up and wrote these crappy lines to make it run.
And is speed essential? It should be used to evaluate the command line.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is ok like this, it is just for comparing the string in the enum. And I agree that it's not worth to re-add boost just for this.

std::for_each( r.begin(), r.end(), [](char& c) { c = ::tolower(c); });
if( !strcmp( l.c_str(), r.c_str() ) )
{
return true;
}
else
{
return false;
}
Comment thread
griwodz marked this conversation as resolved.
Outdated
}

namespace popsift
{

Expand Down Expand Up @@ -197,19 +210,19 @@ void Config::setOrientationMode( OriMode mode )

void Config::setOrientationMode( const std::string& text )
{
if( boost::iequals( text, "BestBin" ) )
if( stringIsame( text, "BestBin" ) )
{
_ori_mode = BestBin;
}
else if( boost::iequals( text, "PopSift" ) )
else if( stringIsame( text, "PopSift" ) )
{
_ori_mode = BestBin;
}
else if( boost::iequals( text, "InterpolatedBin" ) )
else if( stringIsame( text, "InterpolatedBin" ) )
{
_ori_mode = InterpolatedBin;
}
else if( boost::iequals( text, "VLFeat" ) )
else if( stringIsame( text, "VLFeat" ) )
{
_ori_mode = InterpolatedBin;
}
Expand Down Expand Up @@ -256,15 +269,15 @@ void Config::setNormMode( Config::NormMode m )

void Config::setNormMode( const std::string& m )
{
if( boost::iequals( m, "RootSift" ) )
if( stringIsame( m, "RootSift" ) )
{
setNormMode( Config::RootSift );
}
else if( boost::iequals( m, "L2" ) )
else if( stringIsame( m, "L2" ) )
{
setNormMode( Config::Classic );
}
else if( boost::iequals( m, "Classic" ) )
else if( stringIsame( m, "Classic" ) )
{
setNormMode( Config::Classic );
}
Expand Down