フィルターのクリア

How to change one pixel only in plain image?

3 ビュー (過去 30 日間)
Arshub
Arshub 2022 年 1 月 20 日
回答済み: Kevin Holly 2022 年 1 月 20 日
How can I change one pixel in an image?
I need this to calculation NPCR and UACI between to cipher images whose plain images have only a one-pixel difference. hence, ineed original image and original image with edit value of on pixel only to encrypt them.

回答 (1 件)

Kevin Holly
Kevin Holly 2022 年 1 月 20 日
I = imread('peppers.png');
imshow(I)
size(I)
ans = 1×3
384 512 3
I(45,45,1) = 255; % red
I(45,45,2) = 255; % green
I(45,45,3) = 255; % blue
imshow(I)
grayscale_I = rgb2gray(I);
imshow(grayscale_I)
size(grayscale_I)
ans = 1×2
384 512
I(45,45) = 255;
imshow(I)

タグ

製品


リリース

R2014a

Community Treasure Hunt

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

Start Hunting!

Translated by