Changing image rendering?

9 ビュー (過去 30 日間)
aboharbf
aboharbf 2020 年 4 月 18 日
編集済み: Oliver Woodford 2020 年 9 月 21 日
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:
When attempting to visualize the same lines (ignoring the large vertical and horizontal lines), I get the following
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 件のコメント
Oliver Woodford
Oliver Woodford 2020 年 9 月 21 日
編集済み: Oliver Woodford 2020 年 9 月 21 日
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.

サインインしてコメントする。

回答 (1 件)

Oliver Woodford
Oliver Woodford 2020 年 9 月 17 日
編集済み: Oliver Woodford 2020 年 9 月 17 日
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:
  13 件のコメント
Walter Roberson
Walter Roberson 2020 年 9 月 18 日
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.
aboharbf
aboharbf 2020 年 9 月 20 日
@Oliver - I do need the ability to interactively zoom in and out.
@ Walter - I tried the Graphics smoothing but it didn't appear to have any influence unfortunately. Likely due to the plot being purely vertical lines. The function you describe may be worth a shot though, thanks for the tip.

サインインしてコメントする。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by