This file contains 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
clear all; | |
close all; | |
clc; | |
format short | |
%% DLT | |
% Loading 3D World Points and 2D projected points (Ground Truth Points for projection)coming from previous lab | |
World_PTS = load('pts3D.txt'); |
This file contains 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
""" Dataset """ | |
v1 = [1, 1, 0, 0] | |
v2 = [1, 0, 0, 0] | |
v3 = [0, 0, 0, 1] | |
v4 = [0, 0, 1, 1] | |
inputs = [v1, v2, v3, v4] | |
dataset_length = len(inputs) |
This file contains 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 cv2 | |
import numpy as np | |
import matplotlib.pyplot as plt | |
def show_components(labels): | |
# Map component labels to hue val, 0-179 is the hue range in OpenCV | |
label_hue = np.uint8(179*labels/np.max(labels)) | |
blank_ch = 255*np.ones_like(label_hue) | |
labeled_img = cv2.merge([label_hue, blank_ch, blank_ch]) |
This file contains 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 cv2 | |
import numpy as np | |
from scipy import ndimage | |
""" Erosion with OpenCV """ | |
def Erosion_Opencv(img, kernel): | |
cv2.imshow("Input Image", img) | |
cv2.waitKey(0) | |
erosion = cv2.erode(img,kernel,iterations = 1) |
This file contains 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 copy | |
from nonlinear_filtering import padding, Print_Mode | |
import cv2 | |
import numpy as np | |
from enum import Enum | |
import scipy.stats as st | |
class OPERATION_TYPE(Enum): | |
Convolution = 1 |
This file contains 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 copy | |
import cv2 | |
import numpy as np | |
from PIL import Image, ImageFilter | |
from enum import Enum | |
class Filter_Type(Enum): | |
MIN = 1 | |
MAX = 2 |
NewerOlder