borevitzlab / timestreamlib

DEPRECATED. Please use the current version of the TimeStream tools at https://gitlab.com/appf-anu/pyts2.
https://gitlab.com/appf-anu/pyts2
GNU General Public License v3.0
7 stars 4 forks source link

Lots of warnings at start of execution #41

Open Joelgranados opened 10 years ago

Joelgranados commented 10 years ago

While running

python pipeline_demo.py -i /mnt/phenocam/a_data/TimeStreams/Borevitz/BVZ0036/BVZ0036-GC02L-C01~fullres-orig/

from the virtual environment /home/joel/.virtualenvs/timestreamlib/ it seems to always miss the 0 tray. Here is the output of the normal execution:

Process /mnt/phenocam/a_data/TimeStreams/Borevitz/BVZ0036/BVZ0036-GC02L-C01~fullres-orig/2014/2014_06/2014_06_08/2014_06_08_11/BVZ0036-GC02L-C01~fullres-orig_2014_06_08_11_45_00_00.JPG ...
Time stamp 2014-06-08 11:45:00
---perform optical undistortion---
---perform color card detection---
Cannot find color card
---perform color correction---
Skip color correction
---Write image---
---perform tray detection---
Urecoverable error at traydetect: Low tray matching score. Likely tray 0 is missing.

Any ideas????

Joelgranados commented 10 years ago

It finally started to produce some data after a long set of errors. Here is the first image that got detected:

Missing Image
Process /mnt/phenocam/a_data/TimeStreams/Borevitz/BVZ0036/BVZ0036-GC02L-C01~fullres-orig/2014/2014_06/2014_06_18/2014_06_18_09/BVZ0036-GC02L-C01~fullres-orig_2014_06_18_09_00_00_00.JPG ...
Time stamp 2014-06-18 09:00:00
---perform optical undistortion---
---perform color card detection---
/home/joel/.virtualenvs/timestreamlib/local/lib/python2.7/site-packages/timestream-0.1a2-py2.7.egg/timestream/manipulate/correct_detect.py:393: RuntimeWarning: invalid value encountered in power
/home/joel/.virtualenvs/timestreamlib/local/lib/python2.7/site-packages/timestream-0.1a2-py2.7.egg/timestream/manipulate/correct_detect.py:391: RuntimeWarning: invalid value encountered in power
/home/joel/.virtualenvs/timestreamlib/local/lib/python2.7/site-packages/scipy/optimize/minpack.py:419: RuntimeWarning: Number of calls to function has reached maxfev = 10000.
  warnings.warn(errors[info][0], RuntimeWarning)
---perform color correction---
/home/joel/.virtualenvs/timestreamlib/local/lib/python2.7/site-packages/timestream-0.1a2-py2.7.egg/timestream/manipulate/correct_detect.py:427: RuntimeWarning: invalid value encountered in power
/home/joel/.virtualenvs/timestreamlib/local/lib/python2.7/site-packages/timestream-0.1a2-py2.7.egg/timestream/manipulate/pipecomponents.py:255: RuntimeWarning: invalid value encountered in less
/home/joel/.virtualenvs/timestreamlib/local/lib/python2.7/site-packages/timestream-0.1a2-py2.7.egg/timestream/manipulate/pipecomponents.py:256: RuntimeWarning: invalid value encountered in greater
---Write image---
---perform tray detection---
---perform pot detection---
---Performing plant segmentation---
---Writing Image---
---extracting features---
---Writing Features---
Done
Process /mnt/phenocam/a_data/TimeStreams/Borevitz/BVZ0036/BVZ0036-GC02L-C01~fullres-orig/2014/2014_06/2014_06_18/2014_06_18_09/BVZ0036-GC02L-C01~fullres-orig_2014_06_18_09_15_00_00.JPG ...
Time stamp 2014-06-18 09:15:00
chuong commented 10 years ago

Not sure why it has problem detecting tray 0 but images of BVZ0036-GC02L-C01 don't have color card before 2014-06-18.

kdm9 commented 9 years ago

This is (kindof) a duplicate of #83. Closing

Joelgranados commented 9 years ago

Nope, the two issues are different.

These error messages only appear at the beginning of the execution and are definitely not produced by raise PCExBadRunExpects(self.__class__, attrKey) like in 83. please keep open.

kdm9 commented 9 years ago

OK, my bad.

Joelgranados commented 9 years ago

I found this at timestream/manipulate/correct_detect.py#L468. When we do a np.power(TempRGB[0, :]/255.0, ColorGamma[0]) and the base is a negative number. The result is 0 but a warning is thrown.

Joelgranados commented 9 years ago

And we pass a ColorMatrix with negative numbers as part of the least square approximation of the intermediate values in the color correction component. What we should do here is ignore these warnings....

Joelgranados commented 9 years ago

There are more:

  1. There is another one at timestream/manipulate/correct_detect.py#L526, but am unsure if we should ignore it. This one is the same power problems as described above but is not part of a least square search.
  2. There is another in pipecomponents.py:ImageColorCorrector.call: "self.imageCorrected < 0". It warns once in this line. Still unsure why.

This bug requires a bit more exploration.

Joelgranados commented 9 years ago

This is my updated warning output:

17:04:06: ---Perform color card detection---
/usr/lib/python2.7/dist-packages/scipy/optimize/minpack.py:418: RuntimeWarning: Number of calls to function has reached maxfev = 10000.
  warnings.warn(errors[info][0], RuntimeWarning)
17:04:06: ---Perform color correction---
/home/joel/.virtualenvs/timestreamlib/local/lib/python2.7/site-packages/timestream-e9a59eb_dirty-py2.7.egg/timestream/manipulate/correct_detect.py:529: RuntimeWarning: invalid value encountered in power
  CorrectedRGB[0, :] = 255.0*np.power(TempRGB[0, :]/255.0, ColorGamma[0])
/home/joel/.virtualenvs/timestreamlib/local/lib/python2.7/site-packages/timestream-e9a59eb_dirty-py2.7.egg/timestream/manipulate/correct_detect.py:535: RuntimeWarning: invalid value encountered in less
  CorrectedR[np.where(CorrectedR < 0)] = 0
/home/joel/.virtualenvs/timestreamlib/local/lib/python2.7/site-packages/timestream-e9a59eb_dirty-py2.7.egg/timestream/manipulate/correct_detect.py:538: RuntimeWarning: invalid value encountered in greater
  CorrectedR[np.where(CorrectedR > 255)] = 255
/home/joel/.virtualenvs/timestreamlib/local/lib/python2.7/site-packages/timestream-e9a59eb_dirty-py2.7.egg/timestream/manipulate/pipecomponents.py:323: RuntimeWarning: invalid value encountered in less
  self.imageCorrected[np.where(self.imageCorrected < 0)] = 0
/home/joel/.virtualenvs/timestreamlib/local/lib/python2.7/site-packages/timestream-e9a59eb_dirty-py2.7.egg/timestream/manipulate/pipecomponents.py:324: RuntimeWarning: invalid value encountered in greater
  self.imageCorrected[np.where(self.imageCorrected > 255)] = 255
17:04:13: ---Perform tray detection---

Look for the RuntimeWarning...