How to calculate the various intensity value of different color channel of a color image? i need full code in matlab.

10 ビュー (過去 30 日間)
Dear I need to extract the following features of attached image. Please give me a solution to find out those features using matlab.
  1. highest intensity value of red channel
  2. lowest intensity value of red channel
  3. mean intensity value of red channel
  4. median intensity value of red channel.
  1 件のコメント
Guillaume
Guillaume 2018 年 5 月 18 日
Considering that any of these is trivial to do if you've bothered to learn the slightest bit of image processing, why can't you write the 4 lines required to achieve what you want?

サインインしてコメントする。

採用された回答

Florian Morsch
Florian Morsch 2018 年 4 月 25 日
編集済み: Florian Morsch 2018 年 4 月 25 日
You can use 'imhist()' and select the color you want by choosing the correct channel, red is channel 1. You will get a value of each pixel and how often its included in the image. After that you just extract the max. value, min. value (with 'find()' ) and calculate the mean (with 'mean()' ) and median (with 'median()' ).
  6 件のコメント
Florian Morsch
Florian Morsch 2018 年 5 月 18 日
If you want to find the first red value here, you would have to use find like this:
firstValue = find(redhist, 1);
[row, col] = find(redhist, 1);
This will give you the first value, the row and column. For the other values you want just change the find() to your needs.
Guillaume
Guillaume 2018 年 5 月 18 日
Neither imhist nor find is required to answer the questions. Just min, max (or bounds if >=R2017a), mean and median.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeRecognition, Object Detection, and Semantic Segmentation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by