Changing image rendering?
13 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hey All,
attempting to visualize a raster of lines and running into issues. When the lines are plotted as lines, the image appears correctly, as follows:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/285625/image.png)
When attempting to visualize the same lines (ignoring the large vertical and horizontal lines), I get the following
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/285626/image.png)
zooming in, all the same lines are present, just zoomed out they have varying degrees of visibility. Is there a way to modify MATLAB handling of this image to produce an image closer to what appears above?
1 Commento
Oliver Woodford
il 21 Set 2020
Modificato: Oliver Woodford
il 21 Set 2020
I'm just wondering why, if the results using plot are correct, or what you want, why you're trying to rasterize the lines. What is wrong with the approach using plot? If it's rendering time, please share how you call plot.
Risposte (1)
Oliver Woodford
il 17 Set 2020
Modificato: Oliver Woodford
il 17 Set 2020
Basically you are rendering a binary image, and you're getting gray levels instead of just black and white?
What are you using to render the image? imshow() can rescale the image if it is too large. imagesc() doesn't do this.
For example:
>> A = rand(50, 4000) < 0.99;
>> imagesc(A);
>> colormap(gray(256));
when zoomed in gives:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/362332/image.png)
13 Commenti
Walter Roberson
il 18 Set 2020
Maybe conv2() the array with ones() the size of the number of data pixels that will be rendered down to one physical pixel, and logical() the result. That would be equivalent to an OR operation over the entire block.
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!