CapPow / HerbASAP

An effort to automate image post processing for natural history collections
GNU General Public License v3.0
8 stars 3 forks source link

Final processed image actually not being saved #24

Closed dakilaledesma closed 5 years ago

dakilaledesma commented 5 years ago

Issues:

  1. postProcessing.py, white_balance_image(im, r, g, b) will fail in the following lines due to im being NoneType
332: imgR = im[..., 0].copy()
333: imgG = im[..., 1].copy()
334: imgB = im[..., 2].copy()
...
339: im[..., 0] = imgR
340: im[..., 1] = imgG
341: im[..., 2] = imgB

    This is because the image being passed to white_balance_image() is reliant on self.im which is never set (will always be None).

    Temporary fix: Set self.im = im arbitrarily in postProcessing.py line 435.

  1. folderMonitor.py save_output_images() will never save an image due to obj always being False

    Temporary fix: Paste into line 160 in folderMonitor.py: cv2.imwrite(f"your_filename_here.jpg", cv2.cvtColor(im, cv2.COLOR_RGB2BGR))

j-h-m commented 5 years ago

Hey thanks! I was wondering why that thread wasn't running... does implementing the temporary fix(es) result in a working program?

dakilaledesma commented 5 years ago

Yep, doing both changes results in a working save thread during my testing yesterday.

j-h-m commented 5 years ago

Alright I am going to implement your temporary fixes and do a pull request for the threading-dev branch @CapPow. I was going to ask another question in a separate issue, but it seems relevant here since the white_balance_image function seems to be the root of the issue. Why is the white_balance_image function not being run in separate thread?