- Read the watermarked image using the imread function and convert it to grayscale if necessary.
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?
0 个评论
回答(1 个)
Shubham
2023-10-19
To display the peak point of a histogram of a watermarked image in MATLAB, you can follow these steps:
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.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!