fish_gui package

Submodules

fish_gui.brightness module

class fish_gui.brightness.Controller(ip='192.168.0.1')

Bases: PyQt5.QtWidgets.QMainWindow

brightness()

fish_gui.calib_order module

class fish_gui.calib_order.Model(image: numpy.ndarray, corner_number: Tuple[int])

Bases: object

class fish_gui.calib_order.Viewer

Bases: PyQt5.QtWidgets.QMainWindow

dragEnterEvent(self, QDragEnterEvent)
dropEvent(self, QDropEvent)
fish_gui.calib_order.check_order()

return the position and size of the ROI

fish_gui.calib_order.warn(message)

fish_gui.decrypt module

Test script for decrypting data from the TP-Link RBG wireless light

fish_gui.decrypt.decrypt(value, key)

Decrypt the command string

fish_gui.decrypt.encrypt(value, key)

Encrypt the command string

fish_gui.decrypt.main()

Main program function

fish_gui.epipolar module

class fish_gui.epipolar.Model(environment)

Bases: object

property depth
get_ep12(uv)
get_ep21(uv)
property is_valid
property normal
property water_level
class fish_gui.epipolar.StereoImageItem(model, label, plot)

Bases: pyqtgraph.graphicsItems.ImageItem.ImageItem

accept_buddy(buddy)
mouseClickEvent(event)
class fish_gui.epipolar.Viewer

Bases: PyQt5.QtWidgets.QMainWindow

fish_gui.epipolar.epipolar_app()

return the position and size of the ROI

fish_gui.measure_line module

class fish_gui.measure_line.Model(environment=None)

Bases: object

self.get_ep_methods: the function to calculate epipolar lines for different views

measurements_2d

The line segment representing one fish in 3 views, each element is a numpy array, shape: (3 [view], 2 [points], 2 [xy])

Type

list

measurements_3d

The 3D line segment representing one fish, each element is a numpy array, shape: (2 [points], 3 [xyz])

Type

list

add_new_measure(measure_2d)
property depth

400

Type

default value

export_json(filename)

Export all the data to a json file

property index_map

index_map[index_v1][i] = ith neighbour

..code-block

 index_v1   |  first neighbour  | second neighbour
---------------------------------------------------
  0         |  1                |  2
  1         |  0                |  2
  2         |  0                |  1
property is_valid
load_json(filename)

Load data from a json file

property normal

(0, 0, 1)

Type

default value

remove_measure(index)
property water_level

0

Type

default value

class fish_gui.measure_line.StereoImageItem(model, index, epipolar_plots, line, view)

Bases: pyqtgraph.graphicsItems.ImageItem.ImageItem

Canvas for a 3 view setup.

model

the model for the calculaion

Type

Model

index

the index of the view

Type

int

line

the line object for measuring the fish

Type

pg.PolyLineROI

plot

scatter plot for plotting eppipolar line of the self.index view

Type

pg.ScatterPlotItem

neighbours

the other matching views,

Type

StereoImageItem

add_neighbour(stereo_images)

Adding the neighbour views with a fix order order. For different view, the order is different.

..code-block

self.index  | neighbour_1.index | neighbour_2.index
---------------------------------------------------
  0         |  1                |  2
  1         |  0                |  2
  2         |  0                |  1
Parameters

stereo_images (tuple) – a collection of StereoImageItem objects

Returns

None

mouseClickEvent(event)
For the line segment of current view, plot all its corresponding epipolar lines

on the neighbour views.

class fish_gui.measure_line.Viewer(size=(1000, 800))

Bases: PyQt5.QtWidgets.QMainWindow

delete()
export()
load()
measure()

Adding a permenant line plots for the line segments from each view, Calculate the 3D lines based on the 2D line segments. Renderling the 3D lines in the 3D view.

save()
select()
fish_gui.measure_line.line_measure_app()

return the position and size of the ROI

fish_gui.measure_line.warn(message)

fish_gui.roi module

class fish_gui.roi.Model(images)

Bases: object

property back
property max
property min
property next
property rand_max

randomly overlapping 10 images

property rand_min

randomly overlapping 10 images

class fish_gui.roi.Viewer(images, roi)

Bases: PyQt5.QtWidgets.QMainWindow

get_max()
get_min()
load()
save()
fish_gui.roi.iter_video(file_name, roi=None)
fish_gui.roi.measure_roi(images, roi)

return the position and size of the ROI

fish_gui.threshold module

class fish_gui.threshold.Model(images, config_file, background=None)

Bases: object

showing images at different frames

property back
property label
property next
class fish_gui.threshold.Viewer(images, config_path, background)

Bases: PyQt5.QtWidgets.QMainWindow

back()
get_background()
next()
save()
update(self)
update(self, QRect) None
update(self, QRegion) None
Viewer.update(self, int, int, int, int) -> None
update_text()
fish_gui.threshold.get_fg_color(fg)
fish_gui.threshold.get_threshold(images, config, background=None)

get a proper threshold value by manually measurement

fish_gui.tplight module

Control class for TP-Link A19-LB130 RBGW WiFi bulb

class fish_gui.tplight.LB130(ip_address)

Bases: object

Methods for controlling the LB130 bulb

property alias

Get the device alias

property brightness

Get the bulb brightness

color_rendering_index = 0
device_id = ''
encryption_key = 171
property hsb

Get the bulb hue, saturation, and brightness

property hue

Get the bulb hue

incandescent_equivalent = 0
lamp_beam_angle = 0
light_details()

Get the light details from the bulb

max_lumens = 0
max_voltage = 0
min_voltage = 0
off()

Set the bulb to an off state

on()

Set the bulb to an on state

reboot()

Reboot the bulb

property saturation

Get the bulb saturation

status()

Get the connection status from the bulb

property temperature

Get the bulb color temperature

property time

Get the date and time from the device

property timezone

Get the timezone from the device

property transition_period

Get the bulb transition period

wattage = 0

Module contents