DriveHQ Start Menu
Cloud Drive Mapping
Folder Sync
True Drop Box
FTP/SFTP Hosting
Group Account
Team Anywhere
DriveHQ Start Menu
Online File Server
My Storage
|
Manage Shares
|
Publishes
|
Drop Boxes
|
Group Account
WebDAV Drive Mapping
Cloud Drive Home
|
WebDAV Guide
|
Drive Mapping Tool
|
Drive Mapping URL
Complete Data Backup
Backup Guide
|
Cloud-to-Cloud Backup
|
DVR/Camera Backup
FTP, Email & Web Service
FTP/SFTP Hosting
|
Email Hosting
|
Web Hosting
|
Webcam Hosting
Cloud Surveillance & Remote Desktop
Team Anywhere
|
Access Remote PC
|
Cloud Surveillance
|
Virtual CCTV NVR
Quick Links
Security and Privacy
Customer Support
Service Manual
Use Cases
Group Account
Online Help
Support Forum
Contact Us
About DriveHQ
Sign Up
Login
Features
Business Features
Online File Server
FTP Hosting
Cloud Drive Mapping
Cloud File Backup
Email Backup & Hosting
Cloud File Sharing
Folder Synchronization
Group Management
True Drop Box
Full-text Search
AD Integration/SSO
Mobile Access
Personal Features
Personal Cloud Drive
Backup All Devices
Mobile APPs
Personal Web Hosting
Sub-Account (for Kids)
Home/PC/Kids Monitoring
Cloud Surveillance & Remote Desktop
Team Anywhere (Remote Desktop Service)
CameraFTP Cloud Surveillance
Software
DriveHQ Drive Mapping Tool
DriveHQ FileManager
DriveHQ Online Backup
DriveHQ Mobile Apps
CameraFTP Software & Apps
DriveHQ Team Anywhere
Pricing
Business Plans & Pricing
Personal Plans & Pricing
Price Comparison with Others
Feature Comparison with Others
CameraFTP Cloud Recording Service Plans
DriveHQ Team Anywhere Service Plans
Log in
Signing in...
Username or e-mail address is required!
Password is required!
Keep me logged in
Quick Login
Forgot Password
Sign up
Help
Support Home
Support Forum
Service Manual
Online Help
Tutorial videos
Remote Support
About DriveHQ
Contact
CameraFTP Support
Up
Upload
Download
Share
Publish
New Folder
New File
Copy
Cut
Delete
Paste
Rate
Upgrade
Rotate
Effect
Edit
Slide
History
//============================================================================= #include "stereoRecon.h" #include "numericalMath.h" #include
stereoRecon::stereoRecon( const stereoRecon &src, bool invert ) : origImgSizeX_(src.origImgSizeX_), origImgSizeY_(src.origImgSizeY_), e1_(0,0,0), e2_(0,0,0) { if ( !invert ) { F_ = src.F_; Fp_ = src.Fp_; leftP_ = src.leftP_; rightP_ = src.rightP_; e1_ = src.e1_; e2_ = src.e2_; idealReconPnts_ = src.idealReconPnts_; measuredPnts_ = src.idealReconPnts_; avgPntReconError_ = src.avgPntReconError_; avgFReconError_ = src.avgFReconError_; valid_ = src.valid_; } else { F_ = src.F_.transpose(); calcFpAndEpipoles( F_, Fp_, e1_, e2_ ); if ( !Fp_.isValid() ) { valid_=false; return; } computeP( Fp_, e1_, e2_, leftP_, rightP_ ); for ( int i=0; i
(%3i %3i, %3i %3i), (%+6.4f)\n", // (int)((pntList.left(i)[X]+1.0f)*origImgSizeX_/2.0f), // (int)((pntList.left(i)[Y]+1.0f)*origImgSizeY_/2.0f), // (int)((pntList.right(i)[X]+1.0f)*origImgSizeX_/2.0f), // (int)((pntList.right(i)[Y]+1.0f)*origImgSizeY_/2.0f), // (int)((idealReconPnts_.left(i)[X]+1.0f)*origImgSizeX_/2.0f), // (int)((idealReconPnts_.left(i)[Y]+1.0f)*origImgSizeY_/2.0f), // (int)((idealReconPnts_.right(i)[X]+1.0f)*origImgSizeX_/2.0f), // (int)((idealReconPnts_.right(i)[Y]+1.0f)*origImgSizeY_/2.0f), // (reconPntR * Fp_).dot(reconPntL) ); } } avgPntReconError_ /= numReconPnts; avgFReconError_ /= pntList.size(); return true; } bool stereoRecon::epipolarRecon( const vector
&features, int frame1, int frame2, int imgSizeX, int imgSizeY ) { vector
::const_iterator iter; pointMatches2D pntList; for ( iter = features.begin(); iter!=features.end(); iter++ ) { if ( (iter->includesFrame(frame1)) && (iter->includesFrame(frame2)) ) { // feature is present in both images pntList.addMatch( point2D( iter->getSubWindow(frame1).centerX(), iter->getSubWindow(frame1).centerY() ), point2D( iter->getSubWindow(frame2).centerX(), iter->getSubWindow(frame2).centerY() ) ); } } if (pntList.size()<9) return false; else return epipolarRecon( pntList, imgSizeX, imgSizeY ); } matrix3x3 stereoRecon::estimateF( pointMatches2D pntList ) { int i,j; matrixMxN A( pntList.size(), 9 ); vectorN W(9); matrixMxN V(9,9); matrix3x3 F; A.makeZero(); for ( i=0; i
%i\n", W[0], W[1], W[2], W[3], W.smallestComponent()); // // printf("%+6.4f\n", res ); // scenePnt = point3D( V[smallestSV][0]/V[smallestSV][3], // V[smallestSV][1]/V[smallestSV][3], // V[smallestSV][2]/V[smallestSV][3] ); // return true; } void stereoRecon::computeP( const matrix3x3 F, const point3D &e1, const point3D &e2, matrix3x4 &P1, matrix3x4 &P2 ) { // P1 is set to be I P1.makeZero(); P1[0][0] = 1.0f; P1[1][1] = 1.0f; P1[2][2] = 1.0f; // P2 = [ [e2]x F | e2 ] matrix3x3 e2XMat( 0.0f, -e2[2], e2[1], e2[2], 0.0f, -e2[0], -e2[1], e2[0], 0.0f ); P2.setLeft3x3( e2XMat*F ); P2[0][3] = e2[0]; P2[1][3] = e2[1]; P2[2][3] = e2[2]; } void stereoMovieRecon::calcDirectFs( const vector
&features ) { int i,j; stereoRecon *Ftemp; for ( i=0; i
isValid() ) { F_[i][j] = Ftemp; F_[j][i] = new stereoRecon( *Ftemp, true ); if ( !F_[j][i]->isValid() ) { delete F_[j][i]; printf("ERROR: stereoMovieRecon::calcDirectFs\n"); } } else { delete Ftemp; } } } } void stereoMovieRecon::extrapolateFs() { int i,j,k,l; stereoRecon *Ftemp; setvbuf(stdout,0,_IONBF,0); printf(" "); int numRefined=INT_MAX; while ( numRefined>100 ) { numRefined=0; for ( i=0; i
isValid() ) { delete Ftemp; printf("ERROR: stereoMovieRecon::interpolateFs\n"); printf("while interpolating Fp from %2i %2i %2i %2i\n",i,j,k,l); } else if ( F_[i][l]==NULL ) { F_[i][l] = Ftemp; F_[l][i] = new stereoRecon( *Ftemp, true ); } else if ( F_[i][l]->avgPntReconError()>Ftemp->avgPntReconError() ) { delete F_[i][l]; delete F_[l][i]; F_[i][l] = Ftemp; F_[l][i] = new stereoRecon( *Ftemp, true ); numRefined++; } else { delete Ftemp; } } } } } } printf("\nRefined %i",numRefined); } printf("\n"); } stereoRecon * stereoMovieRecon::calcSingleF( int i, int j, int k, int l ) { int idx; pointMatches2D firstToLastMatches; for ( idx=0; idx
getIdealPntMatches().size(); idx++ ) { point3D pointIn1( pointTransfer3View( *F_[i][j], *F_[i][k], F_[j][k]->getIdealPntMatches().left(idx), F_[j][k]->getIdealPntMatches().right(idx) ) ); point3D pointIn4( pointTransfer3View( *F_[l][j], *F_[l][k], F_[j][k]->getIdealPntMatches().left(idx), F_[j][k]->getIdealPntMatches().right(idx) ) ); firstToLastMatches.addMatch( point2D( pointIn1[0]/pointIn1[2], pointIn1[1]/pointIn1[2] ), point2D( pointIn4[0]/pointIn4[2], pointIn4[1]/pointIn4[2] ) ); } stereoRecon *newRecon = new stereoRecon( firstToLastMatches, width_, height_ ); newRecon->measuredPnts_.clear(); newRecon->avgPntReconError_ = F_[i][j]->avgPntReconError_ + F_[j][k]->avgPntReconError_ + F_[k][l]->avgPntReconError_ + F_[i][k]->avgPntReconError_ + F_[j][l]->avgPntReconError_; newRecon->avgFReconError_ = F_[i][j]->avgFReconError_ + F_[j][k]->avgFReconError_ + F_[k][l]->avgFReconError_ + F_[i][k]->avgFReconError_ + F_[j][l]->avgFReconError_; return newRecon; } point3D stereoMovieRecon::pointTransfer3View( const stereoRecon &F31, const stereoRecon &F32, const stereoRecon &F12, const point3D pntInRef12 ) { point3D pnt1( F12.getLeftP() * pntInRef12 ); point3D pnt2( F12.getRightP() * pntInRef12 ); return pointTransfer3View( F31, F32, pnt1, pnt2 ); } point3D stereoMovieRecon::pointTransfer3View( const stereoRecon &F31, const stereoRecon &F32, const point3D &pnt1, const point3D &pnt2 ) { return (F31.getFp()*pnt1).cross(F32.getFp()*pnt2); } point3D stereoMovieRecon::pointTransfer3View( const stereoRecon &F31, const stereoRecon &F32, const point2D &pnt1, const point2D &pnt2 ) { return pointTransfer3View(F31,F32,pnt1.augment(1.0f),pnt2.augment(1.0f)); }
stereoRecon.C
Page URL
File URL
Prev
39/50
Next
Download
( 18 KB )
Note: The DriveHQ service banners will NOT be displayed if the file owner is a paid member.
Comments
Total ratings:
0
Average rating:
Not Rated
Would you like to comment?
Join DriveHQ
for a free account, or
Logon
if you are already a member.