euratom-software / calcam Goto Github PK
View Code? Open in Web Editor NEWPython package of spatial calibration tools for science & engineering camera systems.
License: Other
Python package of spatial calibration tools for science & engineering camera systems.
License: Other
The python import library imp is being depricated in favour of importlib; at some point this will need to be changed in calcam.
Add ability to compare an older / original / as saved version of the current calibration, or maybe another calibration from disk, to the current one in the calibration editor? e.g. showing wireframes in different colours.
Error when passing Coords='original' to calcam.render.render_cam_view:
File "/home/ssilburn/Python/calcam/calcam/render.py", line 290, in render_cam_view
OutputImage = FitResults.transform.display_to_original_image(OutputImage)
File "/home/ssilburn/Python/calcam/calcam/coordtransformer.py", line 122, in display_to_original_image
data_out = cv2.resize(data_out,(self.x_pixels/binning,self.y_pixels/binning),interpolation=cv2.INTER_NEAREST)
TypeError: integer argument expected, got float
There is a long-standing problem where the 3D rendering is badly broken (faces missing, parts out-of-order in depth, etc) on some (but not all) unix systems.
Testing on Linux Mint, it looks like this is related to the embedding of VTK in PyQt. The two attached files in vtk_minimal_test.zip illustrate the problem - two scripts which render an identical scene, one using a VTK window directly (works fine) and one using QVTKRenderWindowInteractor (shows broken rendering).
It would be very useful to be able to add an image mask to a calibration to indicate pixels which do not actually contain good information, e.g. due to the image not filling the detector or something not in the CAD model blocking the view of some pixels.
In the image analyser, for non-visible points the displayed sight-line direction seems to change at the ray-model intersection point. This happens for both continuations of sight-lines and sight-lines towards non-visible points. Not clear whether this is an issue with the image analyser or accuracy of project_points and/or the ray casting.
An exception is raised when clicking the "Browse..." button of an image source unless file name is the last parameter specified in the get_image_arguments list of the image source. This seems to be because of the way the lambda to which the
button is connected is constructed.
Add log image display to make features more visible.
When adding / renaming some features in a CAD model, then trying to delete a feature which had been added in the same session, the following exception is raised:
When doing a 90 degree rotation of both image + point pairs on a set of point pairs which otherwise fit very well, the fitting then does not work properly. If rotating another 90 degrees (to 180) it works OK again.
When opening a GUI tool which prompts to browse or define CAD models under Python 2.x, an exception is raised after browsing for the location. This is due to the path coming back as a QString in Python 2.x and ending up with a QString in CalcamConfig.cad_def_paths.
I think this just needs a fix to the if statement in the do_fit function in the calibration class.
When calling get_ray_data
with no pixel coordinate arguments in order to return the ray end coordinates for the whole image as follows:
surface_coords = ray_data.get_ray_end(coords='Original')
the following exception is raised when coords='Original':
File "/home/tfarley/repos/calcam/calcam/raycast.py", line 609, in get_ray_end return self.transform.display_to_original_image(self.ray_end_coords) File "/home/tfarley/repos/calcam/calcam/coordtransformer.py", line 215, in display_to_original_image raise Exception('Expected (multiple of) {:d}x{:d} pixel image, got {:d}x{:d}!'.format(expected_size[0],expected_size[1],image.shape[1],image.shape[0])) Exception: Expected (multiple of) 256x320 pixel image, got 320x256!
This exception is not raised and the function performs as expected if either specific pixel coordinates are supplied, or coords='Display'
i.e. the error only occurs when returning the full frame of 'Original' ray end coordinates.
Calcam: v2.4.1
If using chessboard images, the fitting tool enables the "Do Fit" button with any number of point pairs. However, if a fit is attempted with fewer than 4 points an exception is raised by OpenCV.
A minimum of 4 points for a fit must be enforced.
I might be useful to have some sliders/tick boxes in the GUI to tailor your image enhancement features to your specific image.
I believe this is fairly specific to Mac-OS. I am using Mac-OS 10.14.2, and VTK 8.1.2
I think the segfault occurs in instances where the editor attempts to pre-load the CAD model whilst rendering the initial window.
I can prevent the segfault by commenting out the two calls
calcam/calcam/gui/virtual_calib.py
Line 222 in 9a39823
and
calcam/calcam/gui/virtual_calib.py
Line 225 in 9a39823
however this is just treating a symptom. I think the root cause must be in some issue that VTK has on Mac-Os with the initial render in these two cases, and it seems like its related to the cases where it attempts to preload the cad model (I think....)
Is it possible to prevent these two editors from pre-loading the CAD model?
When loading a new image during point pair fitting calibration:
It would be really nice to be able to select a check box in the 3D viewer GUI to force the cross-section cut to always be in a vertical plane (perhaps just through the origin if the cursor is more difficult) rather than the default of the plane whose normal is the viewing direction.
I don't know how difficult this would be to implement, but it would enable some really nice figures where you have a cross section of the machine, but could have a tilted view eg looking down at the divertor tiles you are interested in.
In both the point picker and CAD definition GUIs, elements don't update until the next GUI interaction.
Eg. loading of images, CAD models, image enhancements, zooming in CAD and creation/movement of control points don't update until a different tab is clicked, another control point is placed, or another checkbox/button is pressed.
Version numbers:
Calcam: 2.4.0 on win32 using Enthought Canopy 2.1.9.3717
VTK: 7.0.0
OpenCV: 4.1.1
PyQT: 5.13.1
Try using sparse MotionFlow to get point movement between images?
Currently if a raycast point passes through a port or hole in the CAD model, the length of the returned ray is a function of the CAD dimensions and can be confusing to the user. It would be helpful if these ray lengths and end coords are returned as eg nans.
When trying to click a sub-field of a split FOV calibration in the viewport tab, the code seems to try to load a calibration filename based on the sub-FOV name rather than the main save name. For example:
Traceback (most recent call last):
File "/home/pc/calcam/bin/calcam/gui.py", line 944, in change_cad_view
view = fitting.VirtualCalib(str(view_item.text(0)))
File "/home/pc/calcam/bin/calcam/fitting.py", line 1088, in init
self.load(SaveName)
File "/home/pc/calcam/bin/calcam/fitting.py", line 1174, in load
SaveFile = open(os.path.join(paths.virtualcameras,SaveName + '.pickle'),'rb')
IOError: [Errno 2] No such file or directory: '/home/pc/calcam/VirtualCameras/Sub FOV # 1.pickle'
calcam.render_cam_view() currently gives inaccurate results if using VTK 8.2.0 or newer. This makes it extremely difficult to do calibrations using the GUI because CAD wireframe overlays, which are produced using render_cam_view(), are not accurate and therefore misleading. First reported by Jordan Cavalier, confirmed on both Linux & Windows up to VTK 9.0.1.
In the fixes_jan_2018 branch, the split field editor crashes as soon as it tries to add the VTKActor to the renderer. The crash comes from somewhere inside VTK, no python exceptions raised. Seems to happen on both Windows and Linux.
render_cam_view gets the distortion wrong for calibrations where CC is not at the image centre. This is only noticable once the de-centre is quite large, but can be rather significant.
Would be useful to have keyword option to project points outside of image - ie extrapolate and override line 740 in fitting.py .
When saving FitResults generated in the Calcam GUI, the transform actions of the original image appear not to be carrying over to the save.
Add fitting of "inverse" distortion model to calibration class. This is needed by Timo for real-time un-distortion for the MAST-U detachment control.
The --user switch is currently not passed through setup.py to the pip calls, and it really should be.
Ticking the "colour by material" checkbox before loading a CAD model causes an exception and doesn't colour the model once it's loaded. Example:
Traceback (most recent call last):
File "/home/pc/calcam/bin/calcam/gui.py", line 402, in set_cad_colour_by_material
self.cadmodel.colour_by_material(colour_by_material)
AttributeError: 'NoneType' object has no attribute 'colour_by_material'
Image points in calibration tool are invisible!
Happens in Windows under Enthought Canopy, with: Python 3.5.2, OpenCV 3.2.0-2, VTK 7.0.0-2, PyQt 4.12-1
ALso in OpenSUSE with Python 3.4.6, VTK 7.0.0, PyQt 4.8.6, OpenCV 3.1.0.
When renaming loaded 3D data which is not currently enabled:
It would probably be useful to have a GUI for performing intrinsics-only i.e. lab chessboard calibrations, which can then be used to constrain other calibrations, as the basis for virtual calibrations etc. This could also be used in the place of the current chessboard images dialog. Would probably also want to create a new calibration subclass for this.
When entering a number for camera roll in the CAD model editor, the sign is overridden and then displayed wrong.
The geometry matrix module was basically un-touched by the Calcam 2 upgrade and should be updated, possibly with a nice GUI. Needs discussion with jrh and KL11 tomography users. Also this module needs proper documentation.
This then causes exceptions when fitting sub-views with index > 0.
When using the wireframe-ish CAD rendering, the "detect" method is now always used, but the options relating to "simple" are still all present and should be either removed or their functionality be re-instated.
It can be difficult to compare the image and overlay - possibly add ability to draw high contrast guide lines over the image, or have the overlay semi-trsnaprent and improve contrast of the image display?
Finally making the switch to Calcam2!
I used the Calcam1 file converter, which appears to have run fine. I then tried to load old images and CAD models into the Calcam2 point fitting GUI to no avail - images remained black. I then tried clicking on/manipulating the black CAD model canvas, which raised the exception.
The Canny edge detection in the manual alignment tool can be pretty bad for some images - maybe replace it with the FFT edge finding method used in the UCL project?
PyQt4 under Python 3 has no QString, causing the GUI to immediately crash. May well also happen in PyQt5? Needs checking.
When changing what parts of the model are loaded, any camera sight-lines get re-enabled and then cannot be removed.
Once the 3D axisymmetric wall contour feature has been checked in the 3D viewer GUI, unchecking it does not turn off the red surface. Reloading the CAD does not remove the red surface either.
(Low priority)
In some cases the image enhancement is returning images which have overall high levels and what looks like broken contrast scaling.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.