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
imfft=fftshift(fftn(randn(cols,rows,dep))); | |
mag=abs(imfft); | |
phase=imfft./mag; | |
[xi,yi,zi]=meshgrid(1:rows,1:cols,1:dep); | |
radius=sqrt(xi.^2+yi.^2+zi.^2); | |
radius(cols/2+1,rows/2+1,dep/2+1)=1; | |
filter=1./(radius.^factor); | |
im=real(ifftn(fftshift(filter.*phase))); | |
%im=ifftn(fftshift(filter.*phase),'symmetric'); | |
im=rescale(im,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
V=volume(P); | |
% return a vector of the number of sides in each polytope | |
[H,K]=double(P); | |
[numsides, Cncols] = cellfun(@size, H); | |
% return a vector of polytope radii | |
[xyz,Rad] = chebyball(P); | |
% find the extrema of each polytope in P |
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
defined() | |
{ | |
[ ${!1-X} == ${!1-Y} ] | |
} | |
args=("$@") # get arguments passed to the program | |
# if no arguments, IMAGES and CNTRST will be empty otherwise will be filled with the arguments | |
defined args && IMAGES=${args[0]} # first = sample image location e.g. /home/daniel/Desktop/shadow_scanning/sample/ | |
defined args && CNTRST=${args[1]} # second = contrst values - no more than four! e.g. 30.35.40.45 |
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 <stdio.h> | |
#include "cv.h" | |
#include "highgui.h" | |
int main( int argc, char** argv ) | |
{ | |
time_t t1,t2; // initiate timer | |
(void) time(&t1); | |
// define some variables | |
IplImage *im = 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
import os | |
import pprint | |
import sys | |
import wx | |
# use wx with mpl is with the WXAgg backend | |
import matplotlib | |
matplotlib.use('WXAgg') | |
from matplotlib.figure import Figure | |
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigCanvas, NavigationToolbar2WxAgg as NavigationToolbar | |
import numpy as npy |
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
(define (batch-auto-fix pattern | |
radius | |
amount | |
threshold) | |
(let* ((filelist (cadr (file-glob pattern 1)))) | |
(while (not (null? filelist)) | |
(let* ((filename (car filelist)) | |
(image (car (gimp-file-load RUN-NONINTERACTIVE | |
filename filename))) | |
(drawable (car (gimp-image-get-active-layer image)))) |
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
function flower_bed(n) | |
% n is the number of internal circles (must be greater than 2 - greater than 10 looks weird) | |
h = figure; | |
hAxs = axes('Parent',h); | |
axis equal; | |
grid off; | |
hold on; | |
V = 0:2*pi/n:2*pi; |
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
sudo mkdir ~/.config/lxsession | |
sudo mkdir ~/.config/lxsession/LXDE | |
sudo nano ~/.config/lxsession/LXDE/autostart |
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
lxterminal --geometry=50x10 --title="MY TITLE" -e python /usr/bin/my_script.py |
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
lxshortcut -o ~/Desktop/my_launcher.desktop |