This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void R2Image:: | |
blendOtherImageTranslated(R2Image * otherImage) | |
{ | |
R2Image *output = new R2Image(*otherImage); | |
std::vector<Feature> features = this->Harris(3); // passed by value | |
std::vector<Feature>::iterator it; | |
int searchSpaceXDim = this->Width() / 10; // half the search space dimension | |
int searchSpaceYDim = this->Height() / 10; | |
int windowDimension = 12; // half the window dimension |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <vector> | |
#include <iostream> | |
#include "svd.h" | |
using namespace std; | |
struct Point { | |
double x, y; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
std::vector<Feature> R2Image:: | |
Harris(double sigma) | |
{ | |
std::cout << "Computing harris filter" << std::endl; | |
const R2Image self = *this; | |
R2Image *t1 = new R2Image(self); t1->SobelX(); t1->Square(); | |
R2Image *t2 = new R2Image(self); t2->SobelY(); t2->Square(); | |
R2Image *t3 = new R2Image(Width(), Height()); | |
R2Image *t4 = new R2Image(Width(), Height()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void R2Image:: | |
blendOtherImageTranslated(R2Image * otherImage) | |
{ | |
R2Image *output = new R2Image(*otherImage); | |
std::vector<Feature> features = *(this->Harris(3)); | |
int searchSpaceXDim = this->Width() / 10; // half the search space dimension | |
int searchSpaceYDim = this->Height() / 10; | |
int windowDimension = 12; // half the window dimension | |
std::vector<Feature>::iterator it; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void R2Image:: | |
Harris(double sigma) | |
{ | |
std::cout << "Computing harris filter" << std::endl; | |
const R2Image self = *this; | |
R2Image *t1 = new R2Image(self); t1->SobelX(); t1->Square(); | |
R2Image *t2 = new R2Image(self); t2->SobelY(); t2->Square(); | |
R2Image *t3 = new R2Image(Width(), Height()); | |
R2Image *t4 = new R2Image(Width(), Height()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void R2Image:: | |
Blur(double sigma) | |
{ | |
R2Image *temp = new R2Image(width, height); | |
// Generate 1D kernel | |
int k_rad = 3 * sigma; | |
int k_len = 6 * sigma + 1; | |
double *k = (double *) malloc(k_len * sizeof(double)); | |
double sum = 0.0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void R2Image:: | |
SobelX(void) | |
{ | |
R2Image *output = new R2Image(width, height); | |
double sobel_x[3][3] = { | |
{-1, 0, 1}, | |
{-2, 0, 2}, | |
{-1, 0, 1} | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": 1, | |
"size": [15, 15], | |
"values": ["I", "C", "A", "R", "U", "S", " ", "F", "R", "E", "E", " ", "F", "A", "N", | |
"T", "H", "R", "U", "S", "T", " ", "R", "A", "D", "S", " ", "A", "D", "O", | |
"S", "I", "M", "M", "E", "R", " ", "O", "D", "C", "T", "O", "J", "O", "E", | |
"O", "L", "Y", " ", "S", "A", "N", "D", "A", "N", "D", "M", "E", "R", "O", | |
"P", "I", "M", "A", " ", "I", "N", "O", "R", " ", " ", "S", "T", "E", "M", | |
"E", "D", "U", "C", "A", "T", "E", " ", "G", "I", "G", " ", "A", "D", "A", | |
"N", "O", "L", "T", "E", " ", " ", "R", "U", "N", "I", "N", " ", " ", " ", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set output to "paused" | |
if application "Spotify" is running then | |
tell application "Spotify" to set spotifyState to (player state as text) | |
if spotifyState is "playing" then | |
set output to "playing" | |
end if | |
end if | |
if application "iTunes" is running then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if application "Spotify" is running and application "iTunes" is not running then | |
tell application "Spotify" | |
if player state is stopped then | |
set display to "" | |
else | |
set track_artist to artist of current track | |
set track_name to name of current track | |
set track_duration to duration of current track | |
set seconds_played to player position | |
set state to "" |