How to provide dpi/resolution parameter to ZXing Library? - barcode

I am trying to use ZXing to create code 128 based 1D barcodes.
I have a requirement to specify the resolution or dpi parameter to generate the 1D barcode.
But I am unable to find this param in the specification?
Is there any way to do so? What am I missing?
If ZXing does not provide this option, is there any other library which provides the same?
Thanks

Resolution has no meaning here, since nothing in the library is concerned with how large you will physically print or display the image. So, a DPI parameter would not make sense. Instead determine the size in pixels that you need and request that.

Related

is it support the jpeg picture deal with GL_TEXTURE_EXTERNAL_OES mode likes deal with video

For saving memory and improving performance,I want to use a special format texture to deal with jpeg picture. The format handles by GL_TEXTURE_EXTERNAL_OES but process is same to GL_TEXTURE_2D (only different from glBindTexture and shader program texture declaration)
I have done it in egl hardware mode('rasterizer_type': 'direct-gles'). But have problems when I use skia hardware mode ('rasterizer_type': 'hardware'), I found skia hardware mode don`t support it directly and will call render_image_fallback_function_ (HardwareRasterizer::Impl::RenderTextureEGL) to deal with it likes 360 video. I found the result for display is very different from it show in egl hardware mode, It seems that the way only use to deal with 360 video. Is there a way to possible I let skia hardware mode support the special format directly or I only add a new way in TexturedMeshRenderer to deal with picture to distinguish 360 video.
Cobalt/Starboard supports letting the platform define custom (possibly accelerated) image decode functionality in starboard/image.h, are you using this to set GL_TEXTURE_EXTERNAL_OES, or are you modifying common Cobalt code?
If you are modifying Cobalt code, you may want to search through https://cobalt.googlesource.com/cobalt/+/master/src/cobalt/renderer/rasterizer/skia/hardware_image.cc for references to "GL_TEXTURE_2D" and make sure that they still make sense after your changes. In particular, you may need to adjust HardwareFrontendImage::CanRenderInSkia().

How to read image and get your pixels in lua language

I am developing an application that generates images from certain input data through the command "iup.image" and "iup.SaveImage". Now, I need to read this image file again and retrieve the pixels.
I found the command "iup.LoadImage" but I could not find a way to proceed. Can someone help me? I am using LUA language by ZeroBrane Studio.
The pixels of an IUP image can be accessed through the WID attribute in C. IUP images are designed to be simple resources used in buttons, labels and other interface elements.
If you want to manipulate pixels in Lua you should use IM directly. You are already using IM underneath when you call iup.SaveImage and iup.LoadImage.

How can I take a look at my framebuffers?

As the title says, how can I verify if my framebuffers got rendered properly?
Is the best way to use glReadPixels and save the content to an image? If so, is there a simple open source library for doing this?
You can use gDebugger, it's best for the task. Allows to see buffers, textures, calls, states and lots of other useful information.

Are there any C/C++ library for unwarping images?

What I have is a picture taken from the ceiling providing a "radially distorted"/elliptical image. I need to unwarp it and make it a regular rectangular image. How would I do this programmatically using C/C++?
A lot of applications use PanoTools for this. I believe this can also be done with OpenCV.

Save matrix of double values in OpenCV

I have an OpenCV matrix of double (CV_32F) values. I'd like to save it to the disk. I know, I could convert it to an 1-Channel 8-bit IplImage and save it. But that way, I loose precision. Is there a way to save it directly in the 32-bit format, without having to convert it first? It also would be nice, if the resulting file would have an image format, so I can view the result as an image.
You can always save any "object" (CvMat, IplImage, anything..) from OpenCV "as is" by using cvSave() and loading it back with cvLoad(). As to my experience, most floating-point image stuff does not work correctly, I usually save my floating point data this way.
However, you cannot directly view the stored data.
Another possibility we have used frequently is including an own built of OpenEXR. You can easily store full precision floating point images using this library and many third party applications are able to open EXR files. Note that OpenCV includes OpenEXR, if i am not mistaken, but the last time i've tried, saving/loading floating point images did not work correctly. However, you should first try to save an fp image as *.exr, maybe that already does the magic with recent versions.
You could always iterate over the matrix and write it out yourself. If you want it to be viewable as an image, you can use a variant of PPM. I'm not sure what programs would be able to natively read your image format if you use values out of the 0-255 range though.
This is old, but thought I'd throw in my two cents.
If you just want to save float images to disk, and you don't need to view them, you may want to look at Portable Float Map (PFM) image format. Very simple format, just saves floats to disk, no compression, minimal header. You can write your own read/write code for this very quickly. That's what I'm using for HDR research.
As the others pointed out, to "view" float images you need to ask yourself some questions about their contents and how to sensibly scale them back into an 8-bit range you can display on your monitor. You might consider Matlab's image viewer (imshow function) which offers some double scaling functionality.
You might also consider saving to either EXR or HDR format and using Photomatix's built-in HDR image viewer which gives you a little separate window that shows you a real-time tonemapped window around your current cursor position. It's a good way to navigate an HDR or floating point image to get a sense of "what's really there" without tonemapping the whole thing.

Resources