フィルターのクリア

How I can normalize a range of columns of an image

3 ビュー (過去 30 日間)
Mandeep Kaur
Mandeep Kaur 2022 年 5 月 2 日
回答済み: Image Analyst 2023 年 9 月 7 日
I am taking the mean of few coloumns of an image to replce the whole row of the image with mean value. The code is given below
lines = mean(img(:, 400:700), 2);
new_img = img- repmat(lines, 1, size(img, 2));
But the value from coloumns 400:700 varies, so I want to normalize these coloumns. How I can do this?

回答 (1 件)

Image Analyst
Image Analyst 2023 年 9 月 7 日
It doesn't matter that the values in those columns vary. But if img is of type uint8, you need to cast it to double otherwise when subtracting the mean if any values are below 0 it will clip them to 0.

カテゴリ

Help Center および File ExchangeImage Processing and Computer Vision についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by