Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
1f09474
Initial commit for distortion correction and rectification
chuong May 20, 2014
391c970
added color correction and fixed error in writing YML file
chuong May 21, 2014
c8aca38
added image and generate script for CameraTrax 24-color card 2x3in
chuong May 21, 2014
aeb771e
added vectorised version of color correction codes. It should run muc…
chuong Jun 2, 2014
a8e5767
added multiple file processing
chuong Jun 2, 2014
c61239a
add colorbar autodetection
chuong Jun 4, 2014
681927b
added automatic colorbar detection to distortion and color correction
chuong Jun 5, 2014
90511a9
mislaneous changes
chuong Jun 5, 2014
e4f05a0
improved colorbar detectiion
chuong Jun 5, 2014
4ec8dd4
add data for camera distortion and color correction
chuong Jun 10, 2014
95d6c41
remove redundant file
chuong Jun 10, 2014
c56034b
added detection of trays and pots
chuong Jun 11, 2014
fe7fc58
correct output of distortion coefficients
chuong Jun 11, 2014
40f5c73
add templates for trays and pots
chuong Jun 11, 2014
ab832a5
add tray-pot detection with estimated positions
chuong Jun 11, 2014
6e40d0e
save detected positions of trays and pots
chuong Jun 11, 2014
6bdb77e
added new GUI to select color card and tray semi-manually, and utils …
chuong Jun 16, 2014
5a090a4
added initial selection of pot, save selection info and images
chuong Jun 17, 2014
a3184e9
started collecting utilities functions into utils module
chuong Jun 17, 2014
fd6a651
added improved GUI for user inputs, improved pot detection accuracy
chuong Jun 18, 2014
7e246da
renamed pot template
chuong Jun 24, 2014
3ebb908
fixed selection of colorcard
chuong Jun 24, 2014
9d560b2
update GUI to produce YAML file and template images
chuong Jun 24, 2014
5286ec1
added initial processing pipeline code
chuong Jun 24, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions unwarp_rectify/CameraTrax_24ColorCard_2x3in.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# -*- coding: utf-8 -*-
"""
Created on Wed May 21 14:09:56 2014

@author: chuong
"""
from __future__ import absolute_import, division, print_function


import cv2
import numpy as np
from matplotlib import pylab as plt

# RED GRN BLU NAME
CameraTrax_24ColorCard = [ [115, 83, 68],\
[196,147,127],\
[ 91,122,155],\
[ 94,108, 66],\
[129,128,176],\
[ 98,190,168],\
[223,124, 47],\
[ 72, 92,174],\
[194, 82, 96],\
[ 93, 60,103],\
[162,190, 62],\
[229,158, 41],\
[ 49, 66,147],\
[ 77,153, 71],\
[173, 57, 60],\
[241,201, 25],\
[190, 85,150],\
[ 0,135,166],\
[242,243,245],\
[203,203,204],\
[162,163,162],\
[120,120,120],\
[ 84, 84, 84],\
[ 50, 50, 52]]
ColourNames = ['DrkTone', 'LtTone', 'SkyBlue', 'Tree-Grn', 'LtBlu', 'Blu-Grn', \
'Orange', 'MedBlu', 'LtRed', 'Purple', 'Yel-Grn', 'Org-Grn', \
'Blue', 'Green', 'Red', 'Yellow', 'Magenta', 'Cyan', \
'White', 'LtGrey', 'Grey', 'DrkGrey', 'Charcoal', 'Black']
SquareSize = 50 # pixels
P24ColorCard = np.zeros([SquareSize*4, SquareSize*6, 3], dtype = np.uint8)
for i,Colour in enumerate(CameraTrax_24ColorCard):
R,G,B = Colour
Row = int(i/6)
Col = i - Row*6
P24ColorCard[Row*SquareSize:(Row+1)*SquareSize, Col*SquareSize:(Col+1)*SquareSize, 0] = R
P24ColorCard[Row*SquareSize:(Row+1)*SquareSize, Col*SquareSize:(Col+1)*SquareSize, 1] = G
P24ColorCard[Row*SquareSize:(Row+1)*SquareSize, Col*SquareSize:(Col+1)*SquareSize, 2] = B

P24ColorCard_BGR = P24ColorCard[:,:,::-1]
cv2.imwrite('CameraTrax_24ColorCard_2x3in.png', P24ColorCard_BGR)
P24ColorCard_BGR2 = cv2.imread('CameraTrax_24ColorCard_2x3in.png')
if (P24ColorCard_BGR2 != P24ColorCard_BGR).any():
print('Output image is not the same as the actual image')

plt.imshow(P24ColorCard)
plt.show()
Loading