필터 지우기
필터 지우기

How to find image region if coordinates are provided?

조회 수: 2 (최근 30일)
Shilpa Sonawane
Shilpa Sonawane 2024년 1월 3일
댓글: Shilpa Sonawane 2024년 1월 5일
I have coordinates of lip. I have to find lip region from coordinates. Please guide.
  댓글 수: 9
Image Analyst
Image Analyst 2024년 1월 4일
I have no experience with lip reading. My only guidance is to look at the papers of people who do have that experience and have succeeded and published papers on the subject. Their algorithms would be better than anything I could offer you. However it looks like you've Accepted the answer below so everyone assumes you used that and now everything is working.
Shilpa Sonawane
Shilpa Sonawane 2024년 1월 5일
Yes Sir, I have applied the process to extract lip region & done it.
Thank you again.

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

채택된 답변

Hassaan
Hassaan 2024년 1월 3일
A simple example to guide you through the process:
% Let's assume img is your image matrix and lipCoords is an Nx2 array of
% (x, y) coordinates outlining the lip region.
% For example:
% lipCoords = [x1, y1; x2, y2; ... ; xN, yN];
% Create a binary mask
mask = poly2mask(lipCoords(:,1), lipCoords(:,2), size(img, 1), size(img, 2));
% Extract the lip region using the binary mask
lipRegion = img;
lipRegion(~mask) = 0; % This sets all pixels outside the lip region to 0
% Display the original image and the extracted lip region
figure;
subplot(1, 2, 1);
imshow(img);
title('Original Image');
subplot(1, 2, 2);
imshow(lipRegion);
title('Extracted Lip Region');
In the code:
  • poly2mask is a function that converts a polygon to a region mask.
  • lipCoords is assumed to be an array of coordinates for the lip region.
  • mask is the binary mask that represents the lip region.
  • lipRegion is the part of the image with the lips isolated.
Please replace img and lipCoords with your actual image and coordinates. If the coordinates are in a different format or if you have a list of points that do not form a closed polygon, you might need to use different methods to create the mask.
------------------------------------------------------------------------------------------------------------------------------------------------
If you find the solution helpful and it resolves your issue, it would be greatly appreciated if you could accept the answer. Also, leaving an upvote and a comment are also wonderful ways to provide feedback.
Professional Interests
  • Technical Services and Consulting
  • Embedded Systems
  • Electrical and Electronics Engineering
  댓글 수: 1
Shilpa Sonawane
Shilpa Sonawane 2024년 1월 4일
Thank you for guidance. I will apply the steps given by you.
Thank you so much.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by