How can we implement the following in MATLAB?

1 view (last 30 days)
The core idea behind Reversible Hidden Transform is to propose a simple integer transform that transforms an integer pair to another integer pair at a considerably lower mathematical complexity based on some secret parameters. The hidden transform starts by partitioning the image into pairs of pixels. Let [0, L] be the image gray level range (L = 255 for 8-bit gray level images).
Let x = (x1, x2) be a pair of pixels and α, β be two fixed numbers.
Consider y = (y1, y2) is the transformed pair of pixels, and the values are given by
y1 =αx1 + βx2
y2 =βx1 + αx2
since both x1 and x2 lie between [0, L], there may be a situation of underflow (y1 < 0 or y2 < 0 or both) or overflow (y1 > 0 or y2 > 0 or both). In order to avoid underflow and overflow of the transformed pixels, the following conditions should be satisfied:
0 y1 ≤ L; 0y2 ≤ L.
This is possible only when α and β satisfy the relation
α + β = 1 and 0 ≤ α, β ≤ 1.
After posing these constraints, the transform becomes more simple because the secret parameter reduces to one, i.e., either α or β.

Accepted Answer

Image Analyst
Image Analyst on 25 Aug 2012
Edited: Image Analyst on 25 Aug 2012
I think you should give it a try. Maybe the functions randi() or randperm() will be useful to you. Something like this:
grayImage = imread(filename);
[rows columns numberOfColorChannels] = size(grayImage);
outputImage = zeros(rows, columns, 'uint8');
if numberOfColorChannels = 1
grayImage = rgb2gray(grayImage);
end
numberOfPixels = rows * columns;
randomPixelOrder = randperm(numberOfPixels);
for p = 1 : 2 : numberOfPixels
% Get two pixel values from random locations.
x1 = grayImage(randomPixelOrder(p));
x2 = grayImage(randomPixelOrder(p+1));
% You finish it.
y1 = ...
outputImage(.....
end

More Answers (0)

Community Treasure Hunt

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

Start Hunting!