| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Image Processing Toolbox |
| Contents | Index |
| Learn more about Image Processing Toolbox |
h = imgca
h = imgca(hfig)
h = imgca returns the handle of the current axes that contains an image. The current axes can be in a regular figure window or in an Image Tool window.
If no figure contains an axes that contains an image, imgca creates a new axes.
h = imgca(hfig) returns the handle to the current axes that contains an image in the specified figure. (It need not be the current figure.)
imgca can be useful in returning the handle to the Image Tool axes. Because the Image Tool turns graphics object handle visibility off, you cannot retrieve a handle to the tool figure using gca.
Compute the centroid of each coin, and superimpose its location on the image. View the results using imtool and imgca:
I = imread('coins.png');
figure, imshow(I)
Original Image

bw = im2bw(I, graythresh(getimage)); figure, imshow(bw)
Binary Image

bw2 = imfill(bw,'holes'); s = regionprops(bw2, 'centroid'); centroids = cat(1, s.Centroid);
Display original image I and superimpose centroids:
imtool(I) hold(imgca,'on') plot(imgca,centroids(:,1), centroids(:,2), 'r*') hold(imgca,'off')
Centroids of Coins

![]() | imfreehand | imgcf | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |