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
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
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!
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!