-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding radon transform #705
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #705 +/- ##
==========================================
- Coverage 89.18% 86.27% -2.91%
==========================================
Files 13 14 +1
Lines 1211 1290 +79
==========================================
+ Hits 1080 1113 +33
- Misses 131 177 +46
Continue to review full report at Codecov.
|
Hi! Thank you for your interest to contribute! Did you create this according to some reference? I am asking because I lack the domain knowledge to put this into context. From a pure package-maintainer standpoint I will say that I don't think its a good idea to introduce a couple new dependencies for a single function (especially |
Have a look at Algorithm 2.1 'The Discrete Normal Radon Transform` page 28 (47 in PDF) in |
@Evizero @zygmuntszpak , yes I have used the scipy radon transform as a reference to frame this code. I am sorry I involved too many dependencies, I would cut the unnecessary ones. |
Could you please outline the steps in the algorithm that you are trying to implement? Its not clear to me why you would need a projective transformation. The only explanation I can come up with for what you might be trying to do is that you are summing the rows for each column of the image, rotating the image slightly, summing the rows for each column of the rotated image etc. If that is the case, you don't need a projective warp but just a simple rotation. Presumably when you rotate the image slightly the new coordinates of the pixels don't fall onto the pixel grid, and so you need to fill the pixel grid of the rotated image by interpolating? The algorithm that I referenced in my previous post follows a different approach and seems like it can be implemented almost verbatim in Julia. Why not give that one a go? |
@zygmuntszpak , I am sorry I was just trying a different approach to find the radon transform. I was following the code base of scipy radon transform. |
Chapter 8 of the thesis I referenced deals with inverting the radon transform using the filtered back-projection technique. The procedure is split across 3 algorithms (8.1, 8.2 and 8.3). The implementation of the inverse radon transforms appears to be substantially more involved than the radon transform. |
I was wondering why you implemented something that was similar to the algorithm outlined above but not identical. I see that you are actually using Tim Holy's implementation... |
@zygmuntszpak actually earlier only Tim had referenced me that implementation. But I was interested to employee interpolations on both x and y. Then finally since I could not build a feasible code for that so, I decided to use this only. I shall be writing the iradon code, as per your suggestions. Beside that the documentation and test for radon needs to be done also. Seeking your guidance. |
So far I haven't used the Radon transform in my own work so I don't have a deep understanding of it. Hence it would take me a fair bit of time to discern how Tim's implementation relates to the Algorithm that I cited above. Perhaps you could add some comments to clarify the steps of the algorithm? If I were doing this for the first time, I would start by implementing something where the key ideas are explained and the pseudo-code is detailed such as the Algorithm I pasted above. Then, upon receiving Tim's implementation, I would first check that both implementations give my roughly the same results. If they do, I would start teasing apart Tim's implementation to see why it is faster etc. There are some things that I personally find a bit odd in Tim's implementation. For example, instead of Perhaps someone else might have better insight into why Also, it might be worth checking out the ImageJ implementation of the radon transforms. Since ImageJ is used heavily by the medical imaging community I'm pretty sure a lot of thought went into the optimality and correctness of the implementation. |
@zygmuntszpak I have added comments in order to help explanation of the code. |
Thank you, Saloni. I reckon you may as well start working on writing the tests for this. |
@zygmuntszpak I am having trouble in how to claim for a given matrix or image, the radon transform found is correct without employing the inverse radon on that produced image? |
You can test the radon transform on a simple shape for which an analytic expression of the radon transform is known. For example, you could consider a unit disk (filled circle) centred at the origin. I'm sorry but I won't be able to assist you with the OpenCV project. |
Thanks for adding such detailed comments to the code–they help tremendously! |
@zygmuntszpak , I am sorry I am a a bit busy making my proposal for OpenCV.jl project, so could not implement the test code. But I would very soon be completing this work of mine. |
Are you still busy with some of the tests? |
@zygmuntszpak I am sorry I could not address your comment. Yes actually I am pretty swamped with my university tests and exams. I would for sure implement the test code soon. Pardon for the passiveness. Thank you. |
This is also very unlikely to be ever merged given radon transform is provided by https://github.com/JuliaImages/ImageReconstruction.jl |
I have tried building a rough code for radon transform and am expecting guidance and changes from your side to finish it.