Changing pixel colors of .JPG image produces weird colors
조회 수: 2(최근 30일)
app.newImage = app.originalImage;
[imageWidth, imageLength] = size(app.originalImage);
imageLength = imageLength/3;
for row = imageWidth/18 : imageWidth/18 : imageWidth
app.newImage(round(row), :) = 0;
for col = imageLength/36 : imageLength/36 : imageLength
app.newImage(:, round(col)) = 0;
% display new image with grid lines to UI
app.Image.ImageSource = app.newImage;
This code is supposed to draw a grid onto an image. It works, but the vertical lines are blue when their value is set to 0 and red when set to 255. The horizontal lines are black at 0 and green at 255. The grid lines need to all be black. The image is a .jpg read to a property with imread().
Image Analyst 2022년 7월 20일
You could use line() to draw lines in the overlay above the image instead of burning them into the image arrray itself. So do you want the grid lines burned in (so the underlying image, not just the displayed image, is changed), or not?