Can I change the axis in the Image Labeler app?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (1)
Ayush
am 25 Okt. 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!
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!