I tried viewing fingerprint minutiae points using Fingerprint Minutiae viewer. When I do it with a grayscale image from database, it works fine. But after performing image processing functions to enhance the image, when I save the output image using "saveas()" command in Matlab and use this image as input to the FpMV application it gives following error:
Error: Image is not 8-bit grey scale
I tried converting image to grayscale using "im2unit8" but it gave the same error.
Can someone help me in resolving the error?
Here, I'm attaching snapshot of error along with the GUI interface of FpMV:
GUI interface of FpMV along with the error
Related
I am trying to convert a high resolution image (30in width x 60in height) to a pdf file in MATLAB. I tried print, exportgraphics, and couple scripts online but I keep getting low quality output. I also tried setting the resolution to 300dpi but it didnt work. Please if you have any suggestions, share with me and I will test. Many thanks!
Image file used (renamed to map.png): https://upload.wikimedia.org/wikipedia/commons/thumb/d/de/Political_map_of_the_World_%28January_2015%29.svg/9444px-Political_map_of_the_World_%28January_2015%29.svg.png
MATLAB commands used:
world=imread('map.png');
imshow(world)
exportgraphics(gcf,'world.pdf','ContentType','vector','Resolution',300)
#Texts in picture is blurry
print -dpdf 'world.pdf'
#Texts in picture is still blurry
exportfig(gcf, 'world.pdf', 'format','pdf','Resolution', 300,'Renderer', 'painters');
#this is a script from the MATLAB file exchange. Texts still blurry
I managed to do it by importing pdfbox (java) and importing the image as a bufferedimage then creating a document with pdmodel.PDDocument then adding a page with a custom size using the bufferedimage.getWidth and same for length then I streamed the bufferedimage to the page and saved the document to a pdf file. The code is on my work PC if anyone is interested I will copy it here.
I have two time-lapse images of a membrane surface. Both images were supposed to show the same region. But while adjusting focus, captured field might have drifted a bit. I used two routes to visualize the amount of drift - MATLAB v 2021a and ImageJ. With MATLAB, first I tried superimposing two images using imshowpair. Original grayscale images are fix
and mov. imshowpair(mov,fix) yields imshowpair_comp. It clearly shows possible drift. Then I tried using imfuse function as follows:
RF = imref2d(size(fix));
RM = imref2d(size(mov));
RM.XWorldLimits = RF.XWorldLimits;
RM.YWorldLimits = RF.YWorldLimits;
comp = imfuse(fix,RF,mov,RM,'falsecolor','Scaling','joint','ColorChannels',[1 2 0]);
It gave the composite image imfuse_comp. Next, I carried out image registration and I got imregcorr_comp.
tForm = imregcorr(mov,fix,"similarity");
movTransform = imwarp(mov,tForm,"OutputView",RF);
imshowpair(movTransform,fix)
This image shows properly aligned composite image. I tried doing the same using ImageJ.
Open fix.tiff in ImageJ. Image->Colors->Channels Tool->Composite->Red.
Open mov.tiff in ImageJ. Image->Colors->Channels Tool->Composite->Green.
Image->Colors->Merge Channels
This gave the composite image imagej_comp. This composite image obtained from ImageJ clearly shows that there was no misalignment in the two images to begin with!
I am unable to figure out where I went wrong. Now I am really confused between two routes - and which route to believe in. Can someone please help me out?
Thanks!
I am using Matlab's imread to read in images, but about half get read in as all-zeros, even though they are not all-black images (I can view them fine in Finder).
The images that fail vary in their:
file extension (PNG, JPG)
colorspace (RGB, Gray)
color profile (sRGB IEC61966-2.1, Calibrated RGB Colorspace, Generic Gray Gamma 2.2 Profile)
However, I have success reading in other PNG and JPG images in RGB and Gray colorspaces. I don't have any instances of successful reads of an sRGB IEC61966-2.1 color profile, although again, not all images that fail have this profile. I can't see any pattern of file extension, colorspace, etc. that distinguishes that fail from the ones that are read in successfully.
I have tried the following:
[img, map, alpha] = imread('fname.png');. In all cases this produces all-zero matrices for img, map, and alpha.
making the file extension explicit, e.g. imread('fname.png', 'png');. The result is the same.
I am running Matlab 2019b on macOS Catalina.
Any suggestions for what might be causing some images to fail and for how to import them successfully?
The images you linked contain an alpha transparency channel so simply reading using imread() will not return the image data. You need to read the image using additiona parameters as defined on the help page:
[imRGB, map, alpha] = imread('AcbK5pRoi.png');
where the imRGB will contain the RGB image and the Alpha will contain the transparency data.
You can use the imRGB variable as a normal image.
I am new to eeg analysis and so the following the tutorial 'Swartz Center for COmputational Neuroscience'. I am running eeglabv4.5 on matlab (trail version). After loading the dataset it says to select the top Plot menu item, Plot > Channel data (scroll) which should pop up the eegplot() scrolling data window.
But I am getting the following error:
Error: Error using matlab.graphics.Graphics/set The name 'Units' is not an accessible property for an instance of class 'matlab.graphics.GraphicsPlaceholder'. while using plot and channel data scrolling
Downloading eeglab15_0b version solves the issue.
I am struggling with this problem since 2 days. Please help me out on this. I am working on vessel branch segmentation and I have got the code from MathWorks central.
Please download the submission from that site, and open the readme.txt
Before I got an error for converting tiff file to mat file but now it's working. Thank you for the quick reply to my post. But now I am getting the following error
Elapsed time is 0.987052 seconds.
Index exceeds matrix dimensions.
Error in VBSvesselMask (line 20)
meanImg=mean(single(orgImg(:,:,windowSize+1:30)), 3);
Error in VesselBranchSegmentation/CBestimateVesselMask (line 294)
[appImg masks(1).img]= VBSvesselMask(orgImg);
Error while evaluating uimenu Callback
Please help me out.
Use dbstop if error and check the size of orgImg at that point.
It seems the input is expected to be some sort of image stack (3D data or a stack of 2D images, such as a set of 2D images of the same area taken over time). The error indicates that the size of your input image is smaller than what the code expects.
This line of code is the sticking point:
orgImg(:,:,windowSize+1:30)
For this to work, the size of third dimension of orgImg must be at least 30 and the value of windowSize should be appropriately set (somewhere between 0 and 29). Looking at the original code, it appears you are supposed to use the VBSreadtiff function on a entire directory of images, to create an image stack for the code to work on. Using a single grayscale or RGB image will not work.