Clear Filters
Clear Filters

Assign specific gray scale values for a picture

3 views (last 30 days)
is there any way to make a new picture have only the gray scale value that lay between 200 and 205
I wrote this but is did not worrk
Screen Shot 2019-03-20 at 1.57.35 AM.png
I want to write a code that able to determine yallow object fiducials of this picture
Screen Shot 2019-03-20 at 2.00.52 AM.png
and then make it look like that
Screen Shot 2019-03-20 at 2.04.02 AM.png
  1 Comment
Jan
Jan on 20 Mar 2019
Please post code as text and not as screenshot. Suggesting a modification is easy, when copy&paste is possible.
"Did not work" is a very lean description of the problem. Please mention the details. I guess you get a message, that && can be applied to scalar inputs only. You need & as operator. If you read the error message, this should be clear immediately, so I'm not sure, what the problem is.
What does "have only the gray scale value inside range" mean? What should happen with the other values? Maybe you mean:
grey_picture = min(max(grey_picture, 205), 200)
I do not understand the purpos of the attached picture. I guess, only the grey scale part matters, not the idons of the figure. Then it would be useful to crop the parts, which do not concern the question.

Sign in to comment.

Answers (1)

Sultan Al saidi
Sultan Al saidi on 20 Mar 2019
I am trying to create a new picture from gray color picture ,so its only have the pixles intensity that between 200-205 only. and delete the other stuff.
I used this code:
gray_picture=rgb2gray(Im);
gray_picturem=((200<gray_picture)&&(gray_picture<205))
I got the following error massage
Screen Shot 2019-03-20 at 10.43.58 AM.png
the finial result that I am trying to get is should look like this
Screen Shot 2019-03-20 at 2.03.58 AM.png

Community Treasure Hunt

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

Start Hunting!