Closed frigusgulo closed 3 years ago
That error is being raised when trying to initialize a tracking template that extends beyond the image bounds. Either move the starting point away from the image edge, or make the template smaller.
As for the error being raised, I quote the docstring:
"""
Track particles through time.
If more than one motion models are passed (`motion_models`),
errors and warnings are caught silently,
and any images from Observers with :attr:`cache``=True` are cached.
So the current behavior is to catch errors only if you are running more than one motion model. In your example, you passed in one motion model.
xy0 = np.array([ 533528.0,7361411.0,180])[np.newaxis,:] infront = testcam.infront(xy0) xy = xy0[:,0:2]+ np.vstack([xy for xy in itertools.product(range(-200, 200, 25), range(-200, 200, 25))]) elevs = 180*np.ones((xy.shape[0],1)) xy = np.concatenate((xy,elevs),1) uv = testcam.xyz_to_uv(xy) observers[1].images[0].plot() matplotlib.pyplot.scatter(uv[:, 0], uv[:, 1]) plt.show()
Hey Ethan, I think your call on the warped distortion coefficients was correct. Do you think I should go back and re-calibrate? I am fairly dissapointed with open-cv's modules and would be very open to something else if you had reccomendations. We are just about done with a solid approach to the LiDAR stuff as well so at least that is coming along.
From: Ethan Welty notifications@github.com Sent: Thursday, January 28, 2021 9:57 AM To: ezwelty/glimpse glimpse@noreply.github.com Cc: Frankie Dunbar franklyn.dunbar@umontana.edu; Author author@noreply.github.com Subject: Re: [ezwelty/glimpse] IndexError: Box extends beyond grid bounds (#30)
That error is being raised when trying to initialize a tracking template that extends beyond the image bounds. Either move the starting point away from the image edge, or make the template smaller.
As for the error being raised, I quote the docstring:
""" Track particles through time.
If more than one motion models are passed (motion_models
),
errors and warnings are caught silently,
and any images from Observers with :attr:cache``=True
are cached.
So the current behavior is to catch errors only if you are running more than one motion model. In your example, you passed in one motion model.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/ezwelty/glimpse/issues/30#issuecomment-769224601, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AKOECUENRFF2T6S3U5EJQZTS4GJO7ANCNFSM4WT6DJYA.
I doubt there is anything wrong with the performance of the OpenCV camera calibration module, although I wouldn't be surprised if they are a little tricky to use.
As I said back in December, I am not surprised in the least that the calibration is not correct.
These calibration images (in /calibrations/*.jpeg) are likely worse than no calibration at all. The target is small in the image frame, does not appear near image edges, and is visibly warped.
Don't expect a better calibration without better calibration images. As for calibration software, I used to use and enjoy the Camera Calibration Toolbox for MATLAB when I used MATLAB. PhotoModeler's camera calibration is very good (that is what I used in my dissertation for lab calibrations), but the software is not free. Agisoft's Lens (which I believe is free, even if Metashape / Photoscan is not) is decent, especially if you have access to a large, flat computer monitor to display the calibration pattern on – but does not allow manual review and adjustment of the checkerboard corner detection, unlike the other software I mentioned.
As for calibration images, my understanding is that you need up-close images of the chessboard at various angles? Would a set of images like the one attached at different perspectives suffice?
From: Ethan Welty notifications@github.com Sent: Wednesday, February 3, 2021 11:15 AM To: ezwelty/glimpse glimpse@noreply.github.com Cc: Frankie Dunbar franklyn.dunbar@umontana.edu; Author author@noreply.github.com Subject: Re: [ezwelty/glimpse] IndexError: Box extends beyond grid bounds (#30)
I doubt there is anything wrong with the performance of the OpenCV camera calibration module, although I wouldn't be surprised if they are a little tricky to use.
As I said back in December, I am not surprised in the least that the calibration is not correct.
These calibration images (in /calibrations/*.jpeg) are likely worse than no calibration at all. The target is small in the image frame, does not appear near image edges, and is visibly warped.
Don't expect a better calibration without better calibration images. As for calibration software, I used to use and enjoy the Camera Calibration Toolbox for MATLABhttp://www.vision.caltech.edu/bouguetj/calib_doc/ when I used MATLAB. PhotoModeler's camera calibration is very good (that is what I used in my dissertation for lab calibrations), but the software is not free. Agisoft's Lens (which I believe is free, even if Metashape / Photoscan is not) is decent, especially if you have access to a large, flat computer monitor to display the calibration pattern on – but does not allow manual review and adjustment of the checkerboard corner detection, unlike the other software I mentioned.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/ezwelty/glimpse/issues/30#issuecomment-772713620, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AKOECUGLR7RUZLKUXMAOPTLS5GHDVANCNFSM4WT6DJYA.
Trace:
Code:
`path = glob.glob(join(DEM_DIR,"*.tif"))[0] print("DEM PATH: {}".format(path)) dem = glimpse.Raster.open(path=path)
From what I have seen of the code, it looks as though this call should be under the Try/except branch (https://github.com/ezwelty/glimpse/blob/master/src/glimpse/track/tracker.py#L300). My best guess is that the projected camera coordinates called at (https://github.com/ezwelty/glimpse/blob/master/src/glimpse/track/observer.py#L130) are not in the camera image?