Currently, we split a complex valued array into real and imaginary or magnitude and phase for plotting, but for easy and quick at-a-glance plotting of complex valued arrays it can be useful to combine this information into a single image.
In furtherance of this, a pair of utility functions to visualize a complex valued array in a visually compact way in introduced here.
Approach
I add two functions in this pull request.
The first takes a complex valued image and represents the hue as phase, value as magnitude in a HSV colorspace; the saturation is set to one for all image pixels. This is done in the "complexHSV_to_RGB" function. The resulting RGB image of this function can then be used with matplotlib imshow or imsave functions.
The second function "resize_complex_image" uses openCV interpolation to resize an original complex valued to a much larger size (e.g. 128x128 --> 1024x1024) for ease of visual reference; if this is not done then when we use e.g. imsave from matplotlib, the original array size is used to save an image and this smaller array size might be difficult to see without adequate zooming in.
Provide a brief summary of your algorithm(s) here.
-->
For the "complexHSV_to_RGB" function, I use a built in HSV to RGB colorspace conversion function that is a part of matplotlib.
For the "resize_complex_image", I use built in 2D interpolation functions that are part of openCV.
Pre-Merge Checklists
Submitter
[ ] Write a helpfully descriptive pull request title.
[ ] Organize changes into logically grouped commits with descriptive commit messages.
[ ] Document all new functions.
[ ] Click 'details' on the readthedocs check to view the updated docs.
[ ] Write tests for new functions or explain why they are not needed.
[ ] Address any complaints from pep8speaks.
Reviewer
[x] Actually read all of the code.
[x] Run the new code yourself; the included tests should make this easy.
[ ] Write a summary of the changes as you understand them.
Purpose
Currently, we split a complex valued array into real and imaginary or magnitude and phase for plotting, but for easy and quick at-a-glance plotting of complex valued arrays it can be useful to combine this information into a single image.
In furtherance of this, a pair of utility functions to visualize a complex valued array in a visually compact way in introduced here.
Approach
I add two functions in this pull request.
The first takes a complex valued image and represents the hue as phase, value as magnitude in a HSV colorspace; the saturation is set to one for all image pixels. This is done in the "complexHSV_to_RGB" function. The resulting RGB image of this function can then be used with matplotlib imshow or imsave functions.
The second function "resize_complex_image" uses openCV interpolation to resize an original complex valued to a much larger size (e.g. 128x128 --> 1024x1024) for ease of visual reference; if this is not done then when we use e.g. imsave from matplotlib, the original array size is used to save an image and this smaller array size might be difficult to see without adequate zooming in.
Provide a brief summary of your algorithm(s) here. -->
For the "complexHSV_to_RGB" function, I use a built in HSV to RGB colorspace conversion function that is a part of matplotlib.
For the "resize_complex_image", I use built in 2D interpolation functions that are part of openCV.
Pre-Merge Checklists
Submitter
Reviewer