Clear Filters
Clear Filters

Info

This question is closed. Reopen it to edit or answer.

I am getting error in imbinarize function?So which function I should use.Please let me know asap

1 view (last 30 days)
%% clearing clc %%clear command window clear all %%clear value of all variables close all %%close all figures
%% variables %folder = cd; %%get current directory %path = strcat(cd,'\df.jpg'); %%image name to open it
%% step 1 image = imread('D:/canal images/df.jpg'); %%read the image
%% step 2 gray = rgb2gray(image); %%converting RGB to grayscale imshow(gray); title('Gray Scale');
%% step 3 croped = imcrop(gray,[20 70 530 512]); %%imcrop(imag,[x y width height]); To crop the iamge figure imshow(croped); title('Croped Image');
%% step 4 sharpen = imsharpen(croped); %%sharpen image figure imshow(sharpen); title('Sharped Image');
%% step 5 se = strel('disk',3); %%create a disk-shaped structring element bothat = imsubtract(imadd(sharpen,imtophat(sharpen,se)),imbothat(sharpen,se)); %%applying bottom hat method figure imshow(bothat); title('Bottom Hat Method');
%% step 6 level = graythresh(bothat); %%return gary level of image BW = * * imbinarize**(bothat,0.7); %%convert into binary figure imshow(BW); title('Binary Image');

Answers (0)

This question is closed.

Products

Community Treasure Hunt

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

Start Hunting!