why i am getting Undefined variable error?

6 views (last 30 days)
CEM GÖKDEL
CEM GÖKDEL on 30 Dec 2017
Commented: CEM GÖKDEL on 2 Jan 2018
I have a graduation project on matlab related with a bio engineering and computer engineering project. The bio engineers when make some experiments they get some images related with bacteria and they wants to me I'm writing a program in matlab and when they are loading the image from this program they are getting automatically bacteria on the image. So my project advisor said me I was need to use circle detection method, gaussian image filtering, and sharpening filtering and get the blue colored cicrcles on the image and I'm writing one demo program but it gives an error now I share you a program codes please tell me what i make a mistake or mistakes.
This is my program its name is Demo.m:
I = imread(C_Users_GOZDE_Demo.m,'images ov cells.jpg');
I = rgb2gray(I);
b = imsharpen(I);
figure, imshow(b)
title('Sharpened Image');
[centersBlue, radiiBlue] = imfindcircles(I,[20 25],'Object Polarity','blue');
h = fspecial('gaussian');
%/h = fspecial('sobel');
I2 = imfilter(I, h);
imshow(I), title('Original images ov cells');
figure, imshow(I2), title('Filtered iimages ov cells');
  9 Comments
CEM GÖKDEL
CEM GÖKDEL on 1 Jan 2018
Yes I have just C drive my microsoft 7 laptop has just one partition, and also I have a Users in my C drive, and I have a folder named GOZDE inside C:\Users, And I have just DEMO program file inside C:\Users\GOZDE I don't create any folder just create a program file or script file on C:\Users\GOZDE, and I don't have any image folder on C:\Users\GOZDE\Demo.m program file location, I have just experimental image file and it's name is images ov cells.jpg and it is directly inside on C:\. I mean when you enter directly C:\ partition drive you are directly see my experimental image. But my program file path is inside from the C:\Users\GOZDE\Demo.m and I don't create any folder for this program or image. So please tell me what is your advice from me?
CEM GÖKDEL
CEM GÖKDEL on 2 Jan 2018
Yes my friends I solved my problem thank you for your helps. I just create a new folder under the GOZDE and I send my program file and image file in this folder and when I was making this path in my program path on matlab I solved my problem and the program is run. So thank you again and also I know I was late but happy new years for all:))

Sign in to comment.

Answers (1)

KALYAN ACHARJYA
KALYAN ACHARJYA on 30 Dec 2017
Edited: KALYAN ACHARJYA on 30 Dec 2017
I have run it, now there is no error, Please Note there is no space between Object & Polarity, No comma in [centreBlue rediiblue], In the same line I have to change it from blue to 'dark'. Previously It showed no 'blue defined' in Matlab context, that's why I have to changed it.
I=imread('image.jpg'); % Change Image Name as per your image
I=rgb2gray(I);
b=imsharpen(I);
figure, imshow(b); title('Sharpened Image');
[centersBlue radiiBlue]=imfindcircles(I,[20 25],'ObjectPolarity','dark');
h=fspecial('gaussian');
%/h = fspecial('sobel');
I2 = imfilter(I, h);
imshow(I),
title('Original images ov cells');
figure, imshow(I2), title('Filtered images ov cells');
  2 Comments
CEM GÖKDEL
CEM GÖKDEL on 30 Dec 2017
I am trying your code I just make change my image name. Because you also said me change the image name, but again the matlab is give me an undefined variable or class error
Jan
Jan on 30 Dec 2017
@CEM GÖKDEL: A copy of the complete error message would be more useful than the rough rephrasing "matlab is give me an undefined variable or class error".

Sign in to comment.

Categories

Find more on Environment and Settings in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!