Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7776451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:53:16+00:00 2026-06-01T17:53:16+00:00

I want to stretch an elliptical object in an image until it forms a

  • 0

I want to stretch an elliptical object in an image until it forms a circle. My program currently inputs an image with an elliptical object (eg. coin at an angle), thresholds and binarizes it, isolates the region of interest using edge-detect/bwboundaries(), and performs regionprops() to calculate major/minor axis lengths.

Essentially, I want to use the ‘MajorAxisLength’ as the diameter and stretch the object on the minor axis to form a circle. Any suggestions on how I should approach this would be greatly appreciated. I have appended some code for your perusal (unfortunately I don’t have enough reputation to upload an image, the binarized image looks like a white ellipse on a black background).

EDIT: I’d also like to apply this technique to the gray-scale version of the image, to examine what the stretch looks like.

code snippet:

rgbImage = imread(fullFileName);
redChannel = rgbImage(:, :, 1);
binaryImage = redChannel < 90;
labeledImage = bwlabel(binaryImage);
area_measurements = regionprops(labeledImage,'Area');
allAreas = [area_measurements.Area];
biggestBlobIndex = find(allAreas == max(allAreas));
keeperBlobsImage = ismember(labeledImage, biggestBlobIndex);
measurements = regionprops(keeperBlobsImage,'Area','MajorAxisLength','MinorAxisLength')
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T17:53:17+00:00Added an answer on June 1, 2026 at 5:53 pm

    I finally managed to figure out the transform required thanks to a lot of help on the matlab forums. I thought I’d post it here, in case anyone else needed it.

        stats = regionprops(keeperBlobsImage, 'MajorAxisLength','MinorAxisLength','Centroid','Orientation');
        alpha = pi/180 * stats(1).Orientation;
        Q = [cos(alpha), -sin(alpha); sin(alpha), cos(alpha)];
        x0 = stats(1).Centroid.';
        a = stats(1).MajorAxisLength;
        b = stats(1).MinorAxisLength;
        S = diag([1, a/b]);
        C = Q*S*Q';
        d = (eye(2) - C)*x0;
        tform = maketform('affine', [C d; 0 0 1]');
        Im2 = imtransform(redChannel, tform);
        subplot(2, 3, 5); 
        imshow(Im2);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i want to show an image in the browser page and to stretch it
I am working on chat application and i want to stretch chat bubble image
I have an image which I want to scale/stretch it over a trapezoid in
I want Stretch a image. For that i use sprite. I want stretch sprite
I want that my background image stretch and scale depending on the browser viewport
I have an ImageButton: I want to make the image (circular play image) bigger.
I want to contain an image into a 250 x 250 div, forcing the
I want the ability to auto stretch the listview control column when the form
I want to display an image (say 800x800) with Matplotlib.pyplot imshow() function but I
I want to add an image to a UIButton, and also want to scale

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.