필터 지우기
필터 지우기

Make an artificial silhouette of the spray given in image using sine function.

조회 수: 3 (최근 30일)
I would like to make a silhouette of the spray given in image using sine function. I should be able to change the phase angle on both the left and right sides.
  댓글 수: 1
Image Analyst
Image Analyst 2023년 8월 8일
To get a binary image you can use imbinarize. I have no idea what you're talking about when you talk about sine and phase angles. What does that have to do with creating a silhouette?

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

답변 (1개)

Praveen Reddy
Praveen Reddy 2023년 8월 23일
편집: Praveen Reddy 2023년 8월 23일
Hi Edin,
I understand that you are trying to make silhouette of an image. You can use sine function as “amplitude * sin(frequency * x + leftPhaseAngle) to generate y-axis values with varying phase angles for silhouette.
sprayImage = imread('spray_image.jpg');
sprayImage = im2double(sprayImage);
amplitude = 0.5; % Adjust the amplitude as needed
frequency = 0.02; % Adjust the frequency as needed
leftPhaseAngle = pi; % Adjust the phase angle for the left side
rightPhaseAngle = 0; % Adjust the phase angle for the right side
x = 1:size(sprayImage, 2);
% Generate the y-axis values using the sine function with varying phase angles
y = amplitude * sin(frequency * x + leftPhaseAngle);
y = repmat(y, size(sprayImage, 1), 1);
% Apply the silhouette effect to the image using a smooth transition
silhouetteImage = sprayImage .* (1 - y) + y;
figure;
imshow(silhouetteImage);
By experimenting with different values for the parameter's amplitude, frequency, leftPhaseAngle, and rightPhaseAngle in the above code, you can customize the silhouette effect to achieve desired appearance.
To know more about creating a silhouette from an image, please refer to the following MATLAB answer
Hope this helps!

카테고리

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

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by