Commit 1f33b20b authored by biagio montesano's avatar biagio montesano

Removed some other warnings

parent e0da9f93
......@@ -107,8 +107,8 @@ int main( int argc, char** argv )
int B = ( rand() % (int) ( 255 + 1 ) );
/* get extremes of line */
Point pt1 = Point( kl.startPointX, kl.startPointY );
Point pt2 = Point( kl.endPointX, kl.endPointY );
Point pt1 = Point2f( kl.startPointX, kl.startPointY );
Point pt2 = Point2f( kl.endPointX, kl.endPointY );
/* draw line */
line( output, pt1, pt2, Scalar( B, G, R ), 3 );
......
......@@ -610,7 +610,7 @@ int BinaryDescriptor::OctaveKeyLines( cv::Mat& image, ScaleLines &keyLines )
scale[0] = 1;
for ( int octaveCount = 1; octaveCount < params.numOfOctave_; octaveCount++ )
{
scale[octaveCount] = factor * scale[octaveCount - 1];
scale[octaveCount] = (float) ( factor * scale[octaveCount - 1] );
}
/* some variables' declarations */
......@@ -1114,7 +1114,7 @@ int BinaryDescriptor::computeLBD( ScaleLines &keyLines )
desVec = pSingleLine->descriptor.data();
int base = 0;
for ( short i = 0; i < (short) ( NUM_OF_BANDS * 8 ); ++base, i = base * 8 )
for ( short i = 0; i < (short) ( NUM_OF_BANDS * 8 ); ++base, i = (short) ( base * 8 ) )
{
tempM += * ( desVec + i ) * * ( desVec + i ); //desVec[8*i+0] * desVec[8*i+0];
tempM += * ( desVec + i + 1 ) * * ( desVec + i + 1 ); //desVec[8*i+1] * desVec[8*i+1];
......@@ -1130,7 +1130,7 @@ int BinaryDescriptor::computeLBD( ScaleLines &keyLines )
tempS = 1 / sqrt( tempS );
desVec = pSingleLine->descriptor.data();
base = 0;
for ( short i = 0; i < (short) ( NUM_OF_BANDS * 8 ); ++base, i = base * 8 )
for ( short i = 0; i < (short) ( NUM_OF_BANDS * 8 ); ++base, i = (short) ( base * 8 ) )
{
* ( desVec + i ) = * ( desVec + i ) * tempM; //desVec[8*i] = desVec[8*i] * tempM;
* ( desVec + 1 + i ) = * ( desVec + 1 + i ) * tempM; //desVec[8*i+1] = desVec[8*i+1] * tempM;
......@@ -1151,7 +1151,7 @@ int BinaryDescriptor::computeLBD( ScaleLines &keyLines )
{
if( desVec[i] > 0.4 )
{
desVec[i] = (float)0.4;
desVec[i] = (float) 0.4;
}
}
......
......@@ -105,7 +105,7 @@ void BinaryDescriptorMatcher::checkKDistances( UINT32 * numres, int k, std::vect
{
if( ( * ( numres_tmp + j ) ) > 0 )
{
for ( int i = 0; i < (int)( * ( numres_tmp + j ) ) && k_to_found > 0; i++ )
for ( int i = 0; i < (int) ( * ( numres_tmp + j ) ) && k_to_found > 0; i++ )
{
k_distances.push_back( j );
k_to_found--;
......@@ -153,10 +153,10 @@ void BinaryDescriptorMatcher::match( const Mat& queryDescriptors, std::vector<DM
/* data validity check */
if( !masks.empty() && ( masks[itup->second].rows != queryDescriptors.rows || masks[itup->second].cols != 1 ) )
{
std::cout << "Error: mask " << itup->second << " in knnMatch function " << "should have " << queryDescriptors.rows << " and "
<< "1 column. Program will be terminated" << std::endl;
CV_Assert( false );
std::stringstream ss;
ss << "Error: mask " << itup->second << " in knnMatch function " << "should have " << queryDescriptors.rows << " and "
<< "1 column. Program will be terminated";
throw std::runtime_error( ss.str() );
}
/* create a DMatch object if required by mask or if there is
......@@ -170,7 +170,7 @@ void BinaryDescriptorMatcher::match( const Mat& queryDescriptors, std::vector<DM
dm.queryIdx = counter;
dm.trainIdx = results[counter] - 1;
dm.imgIdx = itup->second;
dm.distance = k_distances[0];
dm.distance = (float) k_distances[0];
matches.push_back( dm );
}
......@@ -223,7 +223,7 @@ void BinaryDescriptorMatcher::match( const Mat& queryDescriptors, const Mat& tra
dm.queryIdx = counter;
dm.trainIdx = results[counter] - 1;
dm.imgIdx = 0;
dm.distance = k_distances[0];
dm.distance = (float) k_distances[0];
matches.push_back( dm );
}
......@@ -293,7 +293,7 @@ void BinaryDescriptorMatcher::knnMatch( const Mat& queryDescriptors, const Mat&
dm.queryIdx = counter;
dm.trainIdx = results[j] - 1;
dm.imgIdx = 0;
dm.distance = k_distances[j - index];
dm.distance = (float) k_distances[j - index];
tempVec.push_back( dm );
}
......@@ -375,7 +375,7 @@ void BinaryDescriptorMatcher::knnMatch( const Mat& queryDescriptors, std::vector
dm.queryIdx = counter;
dm.trainIdx = results[j] - 1;
dm.imgIdx = itup->second;
dm.distance = k_distances[j - index];
dm.distance = (float) k_distances[j - index];
tempVector.push_back( dm );
}
......@@ -444,7 +444,7 @@ void BinaryDescriptorMatcher::radiusMatch( const Mat& queryDescriptors, const Ma
dm.queryIdx = i;
dm.trainIdx = results[j] - 1;
dm.imgIdx = 0;
dm.distance = k_distances[j - index];
dm.distance = (float) k_distances[j - index];
tempVector.push_back( dm );
}
......@@ -528,7 +528,7 @@ void BinaryDescriptorMatcher::radiusMatch( const Mat& queryDescriptors, std::vec
dm.queryIdx = counter;
dm.trainIdx = results[j] - 1;
dm.imgIdx = itup->second;
dm.distance = k_distances[j - index];
dm.distance = (float)k_distances[j - index];
tempVector.push_back( dm );
}
......
......@@ -61,7 +61,7 @@ void drawLineMatches( const Mat& img1, const std::vector<KeyLine>& keylines1, co
}
/* initialize random seed: */
srand( time( NULL ) );
srand( (unsigned int) time( NULL ) );
Scalar singleLineColorRGB;
if( singleLineColor == Scalar::all( -1 ) )
......@@ -91,13 +91,13 @@ void drawLineMatches( const Mat& img1, const std::vector<KeyLine>& keylines1, co
for ( size_t i = 0; i < keylines1.size(); i++ )
{
KeyLine k1 = keylines1[i];
line( outImg, Point( k1.startPointX, k1.startPointY ), Point( k1.endPointX, k1.endPointY ), singleLineColorRGB, 2 );
line( outImg, Point2f( k1.startPointX, k1.startPointY ), Point2f( k1.endPointX, k1.endPointY ), singleLineColorRGB, 2 );
}
for ( size_t j = 0; j < keylines2.size(); j++ )
{
KeyLine k2 = keylines2[j];
line( outImg, Point( k2.startPointX + offset, k2.startPointY ), Point( k2.endPointX + offset, k2.endPointY ), singleLineColorRGB, 2 );
line( outImg, Point2f( k2.startPointX + offset, k2.startPointY ), Point2f( k2.endPointX + offset, k2.endPointY ), singleLineColorRGB, 2 );
}
}
......@@ -127,13 +127,13 @@ void drawLineMatches( const Mat& img1, const std::vector<KeyLine>& keylines1, co
matchColorRGB = matchColor;
/* draw lines if necessary */
line( outImg, Point( left.startPointX, left.startPointY ), Point( left.endPointX, left.endPointY ), singleLineColorRGB, 2 );
line( outImg, Point2f( left.startPointX, left.startPointY ), Point2f( left.endPointX, left.endPointY ), singleLineColorRGB, 2 );
line( outImg, Point( right.startPointX + offset, right.startPointY ), Point( right.endPointX + offset, right.endPointY ), singleLineColorRGB,
line( outImg, Point2f( right.startPointX + offset, right.startPointY ), Point2f( right.endPointX + offset, right.endPointY ), singleLineColorRGB,
2 );
/* link correspondent lines */
line( outImg, Point( left.startPointX, left.startPointY ), Point( right.startPointX + offset, right.startPointY ), matchColorRGB, 1 );
line( outImg, Point2f( left.startPointX, left.startPointY ), Point2f( right.startPointX + offset, right.startPointY ), matchColorRGB, 1 );
}
}
}
......@@ -164,7 +164,7 @@ void drawKeylines( const Mat& image, const std::vector<KeyLine>& keylines, Mat&
KeyLine k = keylines[i];
/* draw line */
line( outImage, Point( k.startPointX, k.startPointY ), Point( k.endPointX, k.endPointY ), lineColor, 1 );
line( outImage, Point2f( k.startPointX, k.startPointY ), Point2f( k.endPointX, k.endPointY ), lineColor, 1 );
}
}
......
......@@ -61,6 +61,7 @@
#include <bitset>
#include <time.h>
#include <stdexcept>
#include <sstream>
#include "opencv2/line_descriptor.hpp"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment