Skip to content

Instantly share code, notes, and snippets.

View ritwikraha's full-sized avatar
🎲
learning is probabilistic.

Ritwik Raha ritwikraha

🎲
learning is probabilistic.
View GitHub Profile
@ritwikraha
ritwikraha / photoshop-blend-modes.ipynb
Created November 26, 2021 09:53
Photoshop-Blend-Modes.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
for id = 1:32
sdata = load(strcat('s',num2str(id),'.mat'));
sdata = sdata.data;
slabels = load(strcat('s',num2str(id),'.csv'));
[~,idx] = sort(slabels(:,2));
sortedlabels = slabels(idx,:);
sorteddata = sdata(idx,:,:);
@ritwikraha
ritwikraha / pcnn_feature_map.ipynb
Created November 6, 2020 18:02
PCNN_feature_map.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import cv2
import numpy as np
import dlib
cap = cv2.VideoCapture(0)
detector = dlib.get_frontal_face_detector()
predictor = dlib.shape_predictor("shape_predictor_68_face_landmarks.dat")
while True:
@ritwikraha
ritwikraha / svd_image_compression.ipynb
Created April 13, 2020 15:52
svd_image_compression.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ritwikraha
ritwikraha / wavelet-decomp.m
Created March 19, 2020 14:03
For wavelet decomposition of EEG signals
%Applying bandpass filter to filter out the unwanted signal <4 and >30Hz
yy1=bandpass(SSS1,[4 30],128);
%Apply DWT at 5 level of decomposition
waveletFunction = 'db2';
[C,L] = wavedec(yy1,5,waveletFunction);
cD11 = detcoef(C,L,1);
cD21 = detcoef(C,L,2);
cD31 = detcoef(C,L,3);
cD41 = detcoef(C,L,4);
cD51 = detcoef(C,L,5);
se = strel(3,3);
basic_gradient = imdilate(I,se)- imerode(I,se);
external_gradient= I-basic_gradient;
peakpsnr = psnr(external_gradient,I);
% plotting the power spectral density of the image available
% using the psd plot to obtain further information
psd = imagesc(log10(abs(fftshift(fft2(I))).^2))
mesh(psd);