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
//------------------------------------------------------------------------------ #ifndef RGBIMAGE_H #define RGBIMAGE_H #include "subWindow.h" #include
#include
class floatImage; class bwImage; #define R 0 #define G 1 #define B 2 class rgbImage { public: rgbImage( int w, int h ); rgbImage( floatImage *srcR, floatImage *srcG, floatImage *srcB, bool scaleFromZeroUp=true ); rgbImage( unsigned char *data, int w, int h ); // shallow copy rgbImage( unsigned char *data, int w, int h, bool deep ); // deep copy ~rgbImage(); // deallocates data irrespective of shallow/deep public: int getWidth() const { return width_; } int getHeight() const { return height_; } int getSize() const { return size_; } int getMemSize() const { return memSize_; } void clampInImage( int &x, int &y ); unsigned char *rawData() const { return data_; } unsigned char *pixel( int x, int y ) { return &data_[(y*width_+x)*3]; } void extractRGBComponents( bwImage *&rImg, bwImage *&gImg, bwImage *&bImg ); public: void addSquare( int x1, int y1, int x2, int y2, char r, char g, char b, float trans=1.0f, bool checkInBounds=false ); void addSquare( const subWindow &src, char r, char g, char b, float trans=1.0f, bool checkInBounds=false ); // line specified by ax+by+c=0 void addLine( float ax, float by, float c, char r, char g, char b, float trans=1.0f, int clipXmin=0, int clipYmin=0, int clipXmax=0, int clipYmax=0 ); void addLineSegment( int x1, int y1, int x2, int y2, char r, char g, char b, float trans=1.0f ); void paste( int x, int y, rgbImage *src ); public: // fast gradient (standard technique) // (allocates the memory for the floatImages - user should use delete // when finished) // Gradient based on pixel instensities ( (R+G+B)/3 ) void imgGrad( floatImage *&gradImgX, floatImage *&gradImgY ); // Gradient calculated for each colour component individually void imgGrad( floatImage *&compXR, floatImage *&compXG, floatImage *&compXB, floatImage *&compYR, floatImage *&compYG, floatImage *&compYB ); // quality gradient (Toulouse's technique) // (allocates the memory for the floatImages - user should use delete // when finished) // Gradient based on pixel instensities ( (R+G+B)/3 ) void imgGradToulouse( floatImage *&gradImgX, floatImage *&gradImgY ); // Gradient calculated for each colour component individually void imgGradToulouse( floatImage *&compXR, floatImage *&compXG, floatImage *&compXB, floatImage *&compYR, floatImage *&compYG, floatImage *&compYB ); // Harris Corner Detector (takes image gradient as input) // computes corner response for each colour individually and then finds // the magnitude of the RGB responses at each pixel static floatImage *harrisCornerDetect( floatImage *&compXR, floatImage *&compXG, floatImage *&compXB, floatImage *&compYR, floatImage *&compYG, floatImage *&compYB, int responseWindow ); floatImage *harrisCornerDetect( int responseWindow ); floatImage *harrisCornerDetect_T( int responseWindow ); private: void gradToulouse( int x, int y, float &grdX, float &grdY, int comp ); private: int width_, height_, size_, memSize_; unsigned char *data_; }; inline rgbImage::rgbImage( int w, int h ) : width_(w), height_(h), size_(w*h), memSize_(size_*3*sizeof(unsigned char)) { data_ = (unsigned char*)malloc(memSize_); } inline rgbImage::rgbImage( unsigned char *data, int w, int h ) : data_(data), width_(w), height_(h), size_(w*h), memSize_(size_*3*sizeof(unsigned char)) { } inline rgbImage::rgbImage( unsigned char *data, int w, int h, bool deep ) : width_(w), height_(h), size_(w*h), memSize_(size_*3*sizeof(unsigned char)) { if ( (data_=(unsigned char*)malloc(memSize_))!=0 ) { memcpy( data_, data, memSize_ ); } } inline rgbImage::~rgbImage() { if ( data_!=0 ) free( data_ ); } inline void rgbImage::clampInImage( int &x, int &y ) { if ( x<0 ) x=0; else if (x>=width_) x=width_-1; if ( y<0 ) y=0; else if (y>=height_) y=height_-1; } #endif // RGBIMAGE_H
rgbImage.h
Page URL
File URL
Prev
36/50
Next
Download
( 4 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.