Closed SimeonEhrig closed 3 years ago
what is the best way to write the arrays into images in C++ that works on both linux and windows?
I would suggest, you solve at first issue #1 With this knowledge, you can safe use the Python library to generate the image. But if you really want to use a C++ solution, I would suggest pngwriter.
So issue #1 is still unsolved?
I didn't saw your last commit. GitHub does not notify me, if you do a simple commit. Please write a comment in the related issue (in the best case with linkage to the commit, code line or so one) if your are finish and I should review.
I think in the next VC, we change the your workflow to a Pull Request approach. That's makes much easier for me to review and it is really common in open source development.
But back to the topic, the vector copy example looks good. I think you can use the Python library to write the images. I will do the full review probably tomorrow.
I have difficulties to do it with python, combine with the loop (n time of image) is very confusing. I will try some other alternative for now
It's okay, if you only prints the actual reconstructed images without axis, comparison and so one. The following script should do this:
import imageio
import matplotlib.pyplot as plt
import numpy as np
def main():
file_names = ["a", "b", "c" ,"d"]
file_extension = ".png"
for file_name in file_names:
image = imageio.imread(file_name + file_extension , as_gray=True)
plt.imsave(file_name + "_new" + file_extension, image, cmap='gray')
if __name__ == "__main__":
main()
It is not that part that I have difficulties. It is how do I get the image from phase retrieval to python with loop
@SimeonEhrig could you explain it again what needs to be done with this issue?
The idea is as test, which do the same like python example.py
but do this n times and write the result images to files. I'm not sure, if it is necessary any more. The original idea was, to check if the Python implementation and the CUDA implementation are equals over a series of different initial phases. But now, I think we can say that it is.
I think I can do the argparse part. Should I do it in example.py?
No, makes a extra file. The example.py
should not become to complex.
The algorithm is already stable. No addition tests are necessary.
I saw some strange behavior when running the CUDA implementation on image
a.png
. The object itself was good reconstructed but the orientation or if it was mirrored was constantly changing with each execution.Please write a helper script that allows to run the Python and CUDA implementation of the algorithm n times on an image. The results should be written to files. This is to verify that the algorithm is generally stable. The possible parameters of the script should be: path to the image file, number of iterations of the whole algorithm, number of iterations within the algorithm.
I would suggest argparse to handle the arguments in the helper script.
For this issue, issue #1 and #2 should be solved before.