Borrar filtros
Borrar filtros

Can I change the axis in the Image Labeler app?

1 visualización (últimos 30 días)
Matthew Fall
Matthew Fall el 10 de Jun. de 2022
Comentada: Matthew Fall el 25 de Oct. de 2023
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.

Respuestas (1)

Ayush el 25 de Oct. de 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!
  1 comentario
Matthew Fall
Matthew Fall el 25 de Oct. de 2023
Thank you! I had considered doing it this way, but I think the indices of the labels would be wrong, i.e. the positions of the ROI labels would also need to be flipped.

Iniciar sesión para comentar.





Community Treasure Hunt

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

Start Hunting!

Translated by