- 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!