Gistlib Logo

gistlib

square image with circle in the middle, shortest answer in matlab

main.m
img = imread('image.jpg');
[rows, cols, ~] = size(img);
[r, c] = ndgrid(1:rows, 1:cols);
mask = sqrt((r - rows/2).^2 + (c - cols/2).^2) <= min(rows,cols)/2;
img(~mask) = 255;
imshow(img);
188 chars
7 lines

similar matlab code snippets

detect objects in an image in matlab
count number of dots in an image in matlab
extract strong light-dark transitions in the image by applying a threshold operation to the gradient strength and considering only negative gradients in matlab
find a rectangle in an image in matlab in matlab
draw ioannis politis in matlab
facial recognition in matlab
automatically segment an image using otsu's method in matlab
plot an image of a cat in matlab
draw straight line between x1y1 and x2y2 in image in matlab
draw jack little in matlab

related categories

`matlab
image-processing
computer-vision

gistlibby LogSnag