SylviaCHS / BME547_Final_Project

MIT License
0 stars 1 forks source link

BME547_Final_Project

Huis Cai, Kimberly Lennox, Zhen Lin

last update: 04/28/2019

Overview

For the image processor project, our team designed and implemented a software system to upload image(s) or an archive of images to a web-server, perform image-processing tasks on the web-server, and then display / download the processed image(s).

The following image processing methods can be implemented to the images:

Image(s) can be retrieved by selecting one or multiple files in the listbox. If one image is selected, results will be also displayed in the GUI so that user can compare the original and processed images, as well as the corresponding histograms. Some useful metadata are also available in a pop-up window. When multiple files are selected, a zip archive of the processed image of a specified image type will be stored in a designated folder.

Instruction Manual

Deploy to Virtual Machine

The server has been deployed to VCM. The hostname and port is:

vcm-9030.vm.duke.edu:5000

Note: If want to run it locally, please refer to the other release from branch local_server

View Our Instruction Video!!

For instruction, please watch our instruction video under the git repo master branch called FinalInstructionVideo.mp4. It seems slow but we promise it is faster now!

Upload Image(s) or A Zipfile to Run Analysis on Server

Select and Download Processed Image(s) from Server

On the bottom half of the GUI, it allows users to choose, display, and download images.

For Mac Users

The package Matplotlib does not run well in Mac OS system so the histograms may not be displayed. Please try to use run the code in Windows system.

Status Code

400 : There is an error and data is not processed. Error could include: Missing keys, wrong file type, user ID is not in the database, new user ID already exist, cannot find image in databse, etc. 200 : Requests has been processed sucessfully.

Image Processing

The image processing codes were done mainly utilizing the package scikit-image.

Histogram Equalization

The function used from scikit-image is skimage.exposure.equalize_hist(). For grayscale images, the histogram equalization is done through calling the function once. For color images, the histogram equalizaion is performed in each color channel. The 3 color channels after equalization are used to form a new color image with numpy.dstack.

Contrast Stretching

The function used from scikit-image is skimage.exposure.rescale_intensity(). What this function do is to make sure that the image has utilized the full range of the graylevel. Say, we have a 8-bit image, so the full range would be [0, 255]. If the original image sent in already has pixels with value of 0 and 255, which means the full range of graylevel has already been fully used, this function would actually do no change to the pixel values of the image. This might account for some processed images after contrast stretching look the same as the original ones.

Log Compression

The function used from scikit-image is skimage.exposure.adjust_log(). For some images, no obvious differences appear between the original and processed images happens as the problem addressed above with contrast stretching. But if you check the pixel values, you can see the difference. What accounts for this problem might be the input images are already in good contrast. Because both contrast stretching and log compression are contrast adjustment functions, if the contrast is already good, no great changes can be generated through these functions.

Reverse Video

The function used from scikit-image is skimage.util.invert(). This might be the function that can generate the most obvious change. What it's doing is something like turn white into black or turn black into white.

More details about the functions used from scikit-image can be found on their official webpage: https://scikit-image.org/

Sphinx docstring

All the docstrings of functions can be found in folder html. Feel free to check them. pic1

MIT License

Copyright (c) [2019] [Huisi Cai]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.