Adding points in imagesc matrix
5 views (last 30 days)
Show older comments
Good day,
I have a 2D matrix and I am using imagesc to produce the following diagram:
I need to add extra values to the individual pixels like below:
so that I produce something like below:
I have tried googling on pixel addition but i have reached a dead end... ho can I proceede?
0 Comments
Answers (1)
Image Analyst
on 3 Jan 2020
Use imerode() to enlarge those black regions by 7 pixels around each black pixel.
kernel = true(3, 3);
kernel(1, 2) = false; % Don't use upper middle one so lower middle pixel doesn't go to black.
output = imerode(binaryImage, kernel);
2 Comments
Image Analyst
on 6 Jan 2020
Attach your image and code in a .mat file. Until then, try
imshow(yourMatrix, []);
colormap(gray(256));
See Also
Categories
Find more on Image Processing and Computer Vision in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!