필터 지우기
필터 지우기

How to obtain a group of pixels on an image

조회 수: 1 (최근 30일)
Yuan Yuan Lin
Yuan Yuan Lin 2020년 11월 23일
답변: KSSV 2020년 11월 23일
I have an image and I want to obtain a group of pixels with a distance of about 50 pixels each for both row and column for the entire image.
This is my code so far.
I = imread('balloon.jpg');
[row, col, channel] = size(I);
a = 0;
X = 1 : 50 : col;
for x = 1 : 50 : col
for y = 1:50:row
I(50,x,:) = [255,0,0];
I(y, 50, :) = [255,0,0];
end
end
imshow(I)

채택된 답변

KSSV
KSSV 2020년 11월 23일
If I is an image, you can use:
iwant = I (1: 5: end, 1: 5: end, :);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by