How can i display the peak point of histogram of the watermarked image?

1 次查看(过去 30 天)
How can i display the peak point of histogram of the watermarked image?

回答(1 个)

Shubham
Shubham 2023-10-19
To display the peak point of a histogram of a watermarked image in MATLAB, you can follow these steps:
  1. Read the watermarked image using the imread function and convert it to grayscale if necessary.
watermarkedImage = imread('watermarked_image.jpg');
grayImage = rgb2gray(watermarkedImage); % Convert to grayscale if needed
2. Calculate the histogram of the image using the imhist function.
[counts, bins] = imhist(grayImage);
3. Find the bin index with the maximum count using the max function
[peakCount, peakIndex] = max(counts);
4. Get the corresponding intensity value of the peak using the bin index.
peakIntensity = bins(peakIndex);
5. Plot the histogram and mark the peak point using the plot and hold on functions.
figure;
plot(bins, counts);
hold on;
plot(peakIntensity, peakCount, 'ro', 'MarkerSize', 8);
hold off;
Hope this helps.

Community Treasure Hunt

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

Start Hunting!

Translated by