Skip to content

Instantly share code, notes, and snippets.

##### Exercise 6 Create Voronoi diagram from UCF_CC annotations
#####
##### 24/04/2018
##### Nithikan Srinakrung - Bam
##### DFL, FTSM, UKM
import cv2
##### Exercise 5 Read an image from UCF Crowd dataset and draw lines between people.
##### Lines are between a person and 10 of the most far people from that person.
##### 18/04/2018
##### Nithikan Srinakrung - Bam
##### DFL, FTSM, UKM
import cv2
import scipy.io as sio
import numpy as np
from numpy.matlib import repmat
##### Exercise 4 Pick two points on an image, draw a thick red between these points
##### and show the image.
##### 17/04/2018
##### Nithikan Srinakrung - Bam
##### DFL, FTSM, UKM
import cv2
import random
import numpy as np
import matplotlib.pyplot as plt
##### Exercise 3 Take a one dimensional array of any site (length) and
##### create a two dimentional array out of it with the same elements.
##### 16/04/2018
##### Nithikan Srinakrung - Bam
##### DFL, FTSM, UKM
import numpy as np
def dimension(array,number_of_rows):
result = np.zeros([number_of_rows,len(array)])
##### Exercise 2 Write a function that creates an array based on the function parameter.
##### Function will populate the array with consecutive numbers, then scale them.
##### 12/04/2018
##### Nithikan Srinakrung - Bam
##### DFL, FTSM, UKM
import numpy as np
import time
def scale_number (a,b):
##### Exercise 1 Write function that tests an array for
##### its length not bigger than a certain value
##### 11/04/2018
##### Nithikan Srinakrung - Bam
##### DFL, FTSM, UKM
def compare (a,lim):
if lim >= len(a):
########## Assignment 2-3 Closest person to each person in each image
########## - Calculate the Euclidean Distance between every pair in every annotation
########## - Match everyone with their closet
########## 10/04/2018
########## Nithikan Srinakrung - Bam
########## DF4, FTSM, UKM
import os,sys
##### Assignment 2-2 Center point of the crowd in each image
##### -> Accumulate x and y positions and divide by person count
##### 04/04/2018
##### Nithikan Srinakrung - Bam
##### DF4, FTSM, UKM
import os,sys
import scipy.io as sio
import numpy as np
##### Assignment 2-1 :
##### Total number of people in all images.
##### -> Accumulate the numbers that took from annotations.
##### 03/04/2018 TUE
##### Nithikan Srinakrung - Bam
##### DF4, FTSM, UKM
import os
import scipy.io as sio
@nithikan
nithikan / Assignment1.py
Last active April 3, 2018 03:00
Assignment 1(Python)
#################################
# Assignment 1 #
# Read every mat file in #
# a folder and plot the #
# annotation counts they #
# contain. #
# #
# Author : Nithikan (Bam) #
# Date : 02.04.2018 #
# #