![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/308876/image.jpeg)
How to draw line in the image through the image processing
조회 수: 6 (최근 30일)
이전 댓글 표시
After conducting the evaporator viusalization experiment, want to procced image processing by matlab and found out boundary line between liquid refrigerant and vapor refrigerant. I have tried it with binarize and threshold but didnt get any satisfying result.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/308825/image.jpeg)
here shows my code and the current problem is that i cant get any clear boundary as i can see in the picture with own eyes.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/308828/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/308831/image.png)
i'd like to ask for some advice to get through this problem
댓글 수: 6
Image Analyst
2020년 6월 4일
Can you use polarizers in front of your light and your camera? Rotate the one in front of the camera lens until all the spurious reflections are eliminated. It will be much easier to process without all those reflections in there.
채택된 답변
Rafael S.T. Vieira
2020년 6월 3일
편집: Rafael S.T. Vieira
2020년 6월 3일
Glad to help. I've obtained that image using the Gimp editor, but, it is possible to achieve a similar result in Matlab with:
image = imread("myImage.jpeg");
A = imadjust(image, [0.2 0.8]); % adjusting color levels to enhance the image
M = edge(A(:,:,1), 'sobel') | edge(A(:,:,2), 'sobel') | edge(A(:,:,3), 'sobel'); % sobel to detect edges
N = imdilate(M,ones(5)); % dilate to obtain wider edges
O = bwareaopen(N, 1000); % to remove elements with pixel area smaller than 1000 pixels
imshowpair(image,O,'montage')
I've looked at the image histogram and used the imtool for deciding the previous parameters. The result is the following (you could try adjusting the parameters of any of these functions for obtaining a better result):
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/309476/image.jpeg)
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Convert Image Type에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!