Error in image test

30 views
Skip to first unread message

Luis Entrena

unread,
Apr 4, 2019, 11:37:01 AM4/4/19
to OpenStartracker
I'am just trying to complete my first run. After solving some issues (previous answers were very helpful, thanks!), I got stuck at the image test. I got the following output:

Loading config
Loading hip_main.dat
Filtering stars
Generating DB
Ready

rgb.solve_image('xmas/median_image.png')

Time1: 7.86781311035e-06
Traceback (most recent call last):
  File "startracker.py", line 532, in <module>
    exec(data)
  File "<string>", line 1, in <module>
  File "startracker.py", line 377, in solve_image
    self.current_image=star_image(imagefile,self.median_image)
  File "startracker.py", line 169, in __init__
    contours,heirachy = cv2.findContours(thresh,1,2);
ValueError: too many values to unpack

Traceback (most recent call last):
  File "startracker.py", line 532, in <module>
    exec(data)
  File "<string>", line 1, in <module>
  File "startracker.py", line 377, in solve_image
    self.current_image=star_image(imagefile,self.median_image)
  File "startracker.py", line 169, in __init__
    contours,heirachy = cv2.findContours(thresh,1,2);
ValueError: too many values to unpack

Can you help me? I've tried to use pdb, but it didn't work with the nc pipe. I will appreciate any recommendation to execute the code in debug mode.
Thank you very much in advance.

Andrew Tennenbaum

unread,
Apr 4, 2019, 1:28:34 PM4/4/19
to Luis Entrena, OpenStartracker
Hmm, sounds like it’s not calibrated properly. What images did you use when you ran the calibration?

--
You received this message because you are subscribed to the Google Groups "OpenStartracker" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openstartrack...@googlegroups.com.
To post to this group, send email to opensta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openstartracker/67ff50aa-f0f7-45b0-b1df-6f32b34f8809%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Umair Khan

unread,
Apr 4, 2019, 1:33:08 PM4/4/19
to OpenStartracker
Something else to note: findContours in OpenCV returns 3 things, not 2. So you need another variable to catch all of the results.
To unsubscribe from this group and stop receiving emails from it, send an email to opensta...@googlegroups.com.

Luis Entrena

unread,
Apr 5, 2019, 3:17:54 AM4/5/19
to OpenStartracker
I used the images in xmas for calibration. I've just followed the steps provided in the github for basic setup.
Umair, you're right. I discovered the findContours problem in the meantime and now it works.
By the way, I found a couple of problems in simulator.py. The following lines gave errors because there were negative arguments for sqrt and log10:

flux += flux_per_photon*np.random.normal(0, self.norm_gaussian(self.sigma_psf)*np.sqrt(flux/flux_per_photon), len(flux))
return -2.5 * np.log10(flux / self.base_flux)

I circumvented the problem by using the abs of the argument, but I am pretty sure this is not the right solution!

Thank you all for your fast answer.
Reply all
Reply to author
Forward
0 new messages