Inspection Tools

inspection.tools.utils module

plugins.Thread_inspection.tools.utils.select_file(title, dir_path, file_filter)[source]

Find the file path from the directory computer.

Parameters:
  • title – the title window of open dialog

  • file_filter – determine the specific file want to search

  • dir_path – Navigate to specific directory

Returns:

location

Return type:

file_path

plugins.Thread_inspection.tools.utils.resize_image(image, width)[source]

Resize image original with our size we want

Parameters:
  • () (width) – image original

  • () – image width we want

Returns:

image has been resize

Return type:

result

plugins.Thread_inspection.tools.utils.calculate_height(image, image_width)[source]

Calculate the height image with the same ratio with the size original image.

Parameters:
  • image – original image

  • image_width – size image we want

Returns:

height image

Return type:

height

plugins.Thread_inspection.tools.utils.read_image(image_path)[source]

Reading the image from given file path using openCV.

Parameters:

image_path – The path of image file

Returns:

load image

Return type:

Image

plugins.Thread_inspection.tools.utils.rotate(src, angle, center=None, scale=1.0)[source]

Turn an image in a clockwise or counterclockwise direction.

Parameters:
  • src – original image

  • angle – the value angle for turn the image

  • center – determine the specific coordinate to rotate image

  • scale – scale image

Returns:

rotated image

Return type:

dst image