Problem with image processing using edge detection

조회 수: 8 (최근 30일)
Shahrin Islam
Shahrin Islam 2018년 7월 27일
댓글: Shahrin Islam 2018년 7월 27일
I am trying to do image processing using edge detection on several images. But it's working for all the images except the one I cropped and edited. Please help me. I really need to get this done.
  댓글 수: 2
KALYAN ACHARJYA
KALYAN ACHARJYA 2018년 7월 27일
편집: KALYAN ACHARJYA 2018년 7월 27일
Share the image and your code
Shahrin Islam
Shahrin Islam 2018년 7월 27일
% Display the original Image image = imread('stop.jpeg'); % Read Colour Image and convert it to a grey level Image myimage = rgb2gray(image); % Apply Sobel Operator % Display only Both Edges sobelhz = edge(myimage,'sobel','both'); imshow(sobelhz,[]); title('Sobel - Both Edges');

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

채택된 답변

KALYAN ACHARJYA
KALYAN ACHARJYA 2018년 7월 27일
편집: KALYAN ACHARJYA 2018년 7월 27일
%Change the file name, save as some different name.
% Close Matlab and Restart it again
% Nothing wrong in the following code
clc; clear all; close all;
% Display the original Image
image=imread('safety night.jpg');
% Read Colour Image and convert it to a grey level Image
myimage=rgb2gray(image);
imshow(myimage);
title('Gray Scale Image');
  댓글 수: 1
Shahrin Islam
Shahrin Islam 2018년 7월 27일
Thanks I will give it a try. Can you please enlighten me on the question following the link - https://www.mathworks.com/matlabcentral/answers/412353-want-to-get-all-outputs-together-as-one-in-image-processing
thanks in advance

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

추가 답변 (2개)

Diwakar Ravichandran
Diwakar Ravichandran 2018년 7월 27일
Hi Shahrin,
I tried reproducing the issue,
One thing for you to note in your code is that the name of the image is different in the code. The file is named stopD.jpg, and your code is calling stop.jpeg.
So, that could be one cause of the issue. When I did try to reproduce I got an output which I have attached. Please verify that it is the correct output.
Hope this helps,
Cheers!
  댓글 수: 4
Shahrin Islam
Shahrin Islam 2018년 7월 27일
% Display the original Image image = imread('safety night.jpg');
% Read Colour Image and convert it to a grey level Image myimage = rgb2gray(image); imshow(myimage); title('Gray Scale Image');
Shahrin Islam
Shahrin Islam 2018년 7월 27일
>> gray Attempt to execute SCRIPT gray as a function: C:\Users\User\Desktop\matlab algorithm\images\new\gray.m
Error in images.internal.imageDisplayValidateParams (line 45) common_args.Map = gray(256);
Error in images.internal.imageDisplayParseInputs (line 78) common_args = images.internal.imageDisplayValidateParams(common_args);
Error in imshow (line 241) images.internal.imageDisplayParseInputs({'Parent','Border','Reduce'},preparsed_varargin{:});
Error in gray (line 6) imshow(myimage); title('Gray Scale Image');

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


Shahrin Islam
Shahrin Islam 2018년 7월 27일
In first comment I have attached the code and file and in the second comment I mentioned the code error. Please help me.

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by