Can I change the axis in the Image Labeler app?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
The Image Labeler app uses the default axis ij for displaying its images. Is it possible to make it display its images using axis xy instead?
I know I can set up my ReadFcn in my imageDatastore to flipud the images, but then that would mess up the indices of my labels.
0 commentaires
Réponses (1)
Ayush
le 25 Oct 2023
Hey Max,
I understand that you would like to display images using the "axis xy" convention instead of the default "axis ij" convention.
Unfortunately, it is not possible to change the coordinate system used by the Image Labeler app from "axis ij" to "axis xy". The app is specifically designed to work with the "axis ij" convention to maintain consistency with other image processing functions and adhere to common image coordinate systems used in computer vision and graphics.
However, if you need to work with the "axis xy" convention, you can manually convert the coordinates as needed before or after using the Image Labeler app. One approach is to use the “flipud” function in the “ReadFcn” of your “imageDatastore” to flip the images vertically. This way, you can achieve the desired coordinate system while preserving the label indices.
Here is an example code snippet illustrating this approach:
% Load your original image labels
originalLabels = load('original_labels.mat'); % Assuming labels are stored in 'original_labels.mat'
% Create the imageDatastore with the original images
imds = imageDatastore('path_to_images');
% Apply flipud operation to the images in the ReadFcn of the imageDatastore
imds.ReadFcn = @(filename) flipud(imread(filename));
% Create a new imageDatastore with the flipped images
flippedImds = imageDatastore(imds.Files);
% Assign the preserved labels to the new imageDatastore
flippedImds.Labels = originalLabels;
% Now you can use flippedImds for further processing while preserving the original label indices
For more information on "Image Labeller App”, refer to the MathWorks documentation link below:
Hope the above information helps!
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!