How to get the intensity of pixels of a gray scale image with a gray background around 0.0, with white at +1 and black at -1 ?

조회 수: 2 (최근 30일)
Neural Network Learning purpose

답변 (1개)

Image Analyst
Image Analyst 2016년 5월 7일
Try this:
thePixelIntensity = grayImage(row, column);
If grayImage has values of only 1,0,-1, then thePixelIntensity will obviously have the same values.
  댓글 수: 2
Sleeba Paul
Sleeba Paul 2016년 5월 9일
I would like to ask for a help. In the neural networks assignment we are given with the data of gray scale intensity of the image. I've written the following code in MATLAB to get a new image an extract the gray scale image intensity. I'm getting the following results.
I1=imread('C:\Users\sleeba\Documents\MATLAB\Handwriting Recogntion\eight.jpg');
I2 = imresize(I1,[20 20]);
G=rgb2gray(I2);
mask=true(size(G));
Weight=graydiffweight(G,mask);
Weight=Weight(:)';
Image I've processed
The processed gray scale image
The right processing pattern from the training set ( Not exactly this. Just Take this as an example of desired output)
The condition for right processing is :
Your images need to use floating-point format, with a gray background around 0.0, with white at +1 and black at -1.
Image Analyst
Image Analyst 2016년 5월 9일
If you want an image in the range of -1 to 1, do this
normalizedImage = 2 * mat2gray(grayImage) - 1;

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Image Data Workflows에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by