Am working on Qccpack for Hyperspectral image compression which uses .icb extension.
How can I convert from ENVI .hdr to .icb in order to work with Qccpack ?
I just had a quick look into the Qccpack documentation. (the first thing I found via google, I guess this is what you are talking about)
http://qccpack.sourceforge.net/Documentation/QccIMGImageCubeFree.3.html
.icb is a file that stores "image cubes". They say that image cubes are a data structure for saving volumetric image data.
ENVI .hdr instead is a file format that stores meta data for an image that is stored in another file.
You cannot convert image meta data into image data.
Related
Is there anyway (commandline tools) to calculate MD5 hash for .NEF (also .CR2, .TIFF) regardless any metadata, e.g. EXIF, IPTC, XMP and so on?
The MD5 hash should be same once we update any metadata inside the image file.
I searched for a while, the closest solution is:
exiftool test.nef -all= -o - -m | md5
but 'exiftool -all=' still keeps a set of EXIF tags in the output file. The MD5 hash can be changed if I update remaining tags.
ImageMagick has a method for doing exactly this. It is installed on most Linux distros and is available for OSX (ideally via homebrew) and also Windows. There is an escape for the image signature which includes only pixel data and not metadata - you use it like this:
identify -format %# _DSC2007.NEF
feb37d5e9cd16879ee361e7987be7cf018a70dd466d938772dd29bdbb9d16610
I know it does what you want and that the calculated checksum does not change when you modify the metadata on PNG files for example, and I know it does calculate the checksum correctly for CR2 and NEF files. However, I am not in the habit of modifying RAW files such as you have and have not tested it does the right thing in that case - though I would be startled if it didn't! So please test before use.
The reason that there is still some Exif data left is because the image data for a NEF file (and similar TIFF based filetypes) is located within that Exif block. Remove that and you have removed the image data. See ExifTool FAQ 7, which has an example shortcut tag that may help you out.
I assume your intention is to verify the actual image data has not been tampered with.
An alternate approach to stripping the meta-data can be to convert the image to a format that has no metadata.
ImageMagick is a well known open source (Apache 2 license) for image manipulation and conversion. It provides libraries with various language bindings as well as command line tools for various operating systems.
You could try:
convert test.nef bmp:- | md5
This converts test.nef to bmp on stdout and pipes it to md5.
AFAIR bmp has no support for metadata and I'm not sure if ImageMagick even preserves metadata across conversions.
This will only work with single image files (i.e. not multi-image tiff or gif animations). There is also the slight possibility some changes can be made to the image which result in the same conversion because of color space conversions, but these changes would not be visible.
I have images that I upload to a server using Amazon S3. I convert them to NSData, using UIImageJPEGRepresentation with 0.75f compression quality. Now I'd like to compare them and see if they are equal.
With PNG, it's easy, all I had to do is this:
if (UIImagePNGRepresentation(self.pictureImageView.image) isEqual:
UIImagePNGRepresentation(manageItemVC.pictureImage)]) {}
as stated here. And that would work, but now the images are JPEG, and the comparison isn't working (most likely due to compression), even if I use UIImageJPEGRepresentation.
self.pictureImageView.image is the image from the server that I've loaded into an UIImageView, and manageItemVC.pictureImage is an image that the user picked from the photo library.
Anyone know how to compare JPEG images?
You can check data's length of two image and compare it.
With my suggestion, i check if two data different about 10000 => two image different.
I have a database of images that i processed and saved as:
IplImage* database[10000];
database[0]= image1
database[1]= image2
... etc
Now I want to save this database IplImage matrix. How can i do this ? I know i can loop over all the images and save them one by one, but that is not really what i am looking for.
I read something like cvSave and cvLoad which allows me to save and load in one command but i am getting an error when i use it (cvSave("myimagedatabase.xml",&database);). Can you please guide me ?
Thank you in advance
If you don't want to save them as individual images what about using a sequence of images - also known as a movie?
See opencv cvVideoWriter, if you select 0 as the codec they will be saved uncompressed
What I gather from your question is that you are interested in saving strictly the data to some file, and then reloading back at a later point and that you would not be interested in opening the stored data in an image editing program or something like this.
First thing to consider, what are the important parts of IplImage
* depth
* height
* width
* nChannels
* imageData array
What I would do is in a loop for each IplImage make a function to write each data value into a binary file. Give the file a header noting how many images there are. Using depth, height width and nChannels you can compute the size of the imageData array. Assuming all have the same depth (IPL_DEPTH_8U for example) then this should be easy, if they vary this can get tricky.
To load the data simply read in the binary data and header information and one by one loop through all the data and create new IplImages based on that data.
I have a directory structure containing 300 gigs worth of Tiff Images. Some are encoded as Jpeg-in-Tiff, others as "Group 4 fax encoding". I need to change the format of all to the later without losing my folder structures.
Anyone have any ideas?
Pretty much any image viewer with a batch conversion shoudl do this I like irfanview
I'm having a proprietary image format SNG( a proprietary format) which is having a countinous array of Image data along with Image meta information in seperate HDR file.
Now I need to convert this SNG format to a Standard TIFF 6.0 Format. So I studied the TIFF format i.e. about its Header, Image File Directories( IFD's) and Stripped Image Data.
Now I have few concerns about this conversion. Please assist me.
SNG Continous Data vs TIFF Stripped Data: Should I convert SNG Data to TIFF as a continous data in one Strip( data load/edit time problem?) OR make logical StripOffsets of the SNG Image data.
SNG Data Header uses only necessary Meta Information, thus while converting the SNG to TIFF, some information can’t be retrieved such as NewSubFileType, Software Tag etc.
So this raises a concern that after conversion whether any missing directory information such as NewSubFileType, Software Tag etc is necessary and sufficient condition for TIFF File.
Encoding of each pixel component of RGB Sample in SNG data:
Here each SNG Image Data Strip per Pixel component is encoded as:
Out^[i] := round( LineBuffer^[i * 3] * **0.072169** + LineBuffer^[i * 3 + 1] * **0.715160** + LineBuffer^[i * 3+ 2]* **0.212671**);
Only way I deduce from it is that each Pixel is represented with 3 RGB component and some coefficient is multiplied with each component to make the SNG Viewer work RGB color information of SNG Image Data. (Developer who earlier work on this left, now i am following the trace :))
Thus while converting this to TIFF, the decoding the same needs to be done. This raises a concern that the how RBG information in TIFF is produced, or better do we need this information?.
Please assist...
Are you able to load this into a standard windows bitmap handle? If so, there are probably a bunch of free and commercial libraries for saving it as TIFF.
The standard for TIFF is libtiff -- it's a C library. Here's a version for Delphi made by an expert in the TIFF format:
http://www.awaresystems.be/imaging/tiff/delphi.html
There seems to be a lot of choices.
I think the approach of
Loading your format into an in-memory standard bitmap (which you need to do to show it, right?)
Using a pre-existing TIFF encoding library to save as TIFF
Will be a lot easier than trying to do a direct format-to-format conversion. The only reasons I wouldn't do it this way are:
The bitmap is too big to keep in memory
The original format is lossy and I will lose more quality in the re-encoding -- but you'd have to be saving in a standard lossy format (JPEG) to save quality.
Disclaimer: I work for Atalasoft.
We make .NET imaging codecs (including TIFF) -- that are a lot easier to use than LibTiff -- you can call them in Delphi through COM. We can convert standard windows bitmaps to TIFF or PDF (or other formats) with a couple of lines of code.
One approach, if you have a Windows application which handles and can print this format, would be to let it do the work for you, and call it to print the file to one of the many available 'printer drivers' which support direct output to TIFF.