Microblink SDK: Take only the photo which is inside rectangle - reactjs

I am using Microblink Sdk with reactjs. So, when I open the camera to take the photo of some document it takes the picture of whole frame not just inside the reactange.
Is there any option to take only the picture only inside the rectangle.
Thanks!!!

The rectangle displayed on the screen is there to help the user position the document they are scanning.
Specifically, the detection of the document and data extraction works best if the entire image is sent to processing, and if the document is positioned roughly around the rectangle.
That means that if you “cropped” the image to the rectangle before recognition, you would effectively lower the success rate of scanning or you would have to move the camera further away from the document to keep it in that sweet spot where the document has a margin around it, resulting in a lower resolution image, lowering the success rate once more and defeating the purpose of the initial cropping.

Related

Animated gif texture in 3ds max

and thanks in advance.
I don't know what I am doing wrong, I have created an animated .gif in Photoshop to use as a texture map for a model in 3ds max 2010. The Texture displays well enough in max and in renders, however it is not animated. I had it working at one point, but I cannot figure out what I might have changed in the settings that would cause animated textures to not play. That being said; I am very interested in learning of other file types that are better suited for animated textures in Max.
Try use image sequence (png,tiff)
Save each frame animation as file with names
some_name__000.ext
some_name__001.ext
some_name__002.ext
and load first as image sequence.
Max will create IFL file when you load texture as image sequence
Next time you can load IFL
IFL is text file, so it is easy to edit

OpenGL: How to drag image and move it to the line by using the mouse

I want to drag an image to one line by using the mouse and when the image is close to the line, the image will automatically move on to the line, like some "floor planner" program ------------you create wall and drag the door to this wall and when the door is close to the wall, the door will automatically show up on the wall.
Can OpenGL do it?
if it can, can anyone tell me how? If it can not, can anyone tell me how I can do it?
Show me an example.
OpenGL is a rendering API, it's purpose is to generate rasterized images based on descriptions provided to it by an application.
It knows nothing about user input, and even less about the application's "domain objects" such as doors, walls, and so on. All it deals with is abstract coordinates and matrices that describe the transforms and projections to take those 3D coordinates into 2D for rasterization, as well as shading for surfaces and so on.
So, it's up to you to implement that, so that the coordinates you eventually pass to OpenGL end up being what you want them to be.
Snapping is typically a combination of measuring the distance to some guiding object, and the following quantization of the input coordinates to correspond to the the guide.

C, GTK: display stream of RGB images at < 60 fps

I'm developing an application that shall receive images from a camera device and display them in a GTK window.
The camera delivers raw RGB images (3 bytes per pixel, no alpha channel, fixed size) at a varying frame rate (1-50 fps).
I've already done all that hardware stuff and now have a callback function that gets called with every new image captured by the camera.
What is the easyest but fast enough way to display those images in my window?
Here's what I already tried:
using gdk_draw_rgb_image() on a gtk drawing area: basically worked, but rendered so slow that the drawing processes overlapped and the application crashed after the first few frames, even at 1 fps capture rate.
allocating a GdkPixbuf for each new frame and calling gtk_image_set_from_pixbuf() on a gtk image widget: only displays the first frame, then I see no change in the window. May be a bug in my code, but don't know if that will be fast enough.
using Cairo (cairo_set_source_surface(), then cairo_paint()): seemed pretty fast, but the image looked striped, don't know if the image format is compatible.
Currently I'm thinking about trying something like gstreamer and treating those images like a video stream, but I'm not sure whether this is like an overkill for my simple mechanism.
Thanks in advance for any advice!
The entire GdkRGB API seems to be deprecated, so that's probably not the recommended way to solve this.
The same goes for the call to render a pixbuf. The documentation there points at Cairo, so the solution seems to be to continue investigating why your image looked incorrect when rendered by Cairo.
unwind is right, cairo is the way to go if you want something that will work in GTK2 and GTK3. As your samples are RGB without alpha, you should use the CAIRO_FORMAT_RGB24 format. Make sure the surface you paint is in that format. Also try to make sure that you're not constantly allocating/destroying the surface buffer if the input image keeps the same size.

Zoom far in on an image with Xlib

I have an ximage which I want to zoom in on, and display. I'm currently taking the naive approach:
allocate bigger image
use nearest-neighbor interpolation to fill it in.
put the whole image on a pixmap.
Which works, but slowly, and crawls once I approach bigger zoom levels, like 800%. The gimp, however, can zoom in to 3200% and still feel snappy. What's the approach taken here? Should I only fill one screen at a time? But then what about scrolling: wouldn't performing interpolation, and an XPutImage, and an XCopyArea on each expose kill performance?
I'm not expert in Xlib, but in my opinion a good approach would be to draw only the zoomed part, instead of computing the interpolation of the entire image.
For scrolling, if you are looking for performances, you may copy the part of the old zoom which is still visible in the new position, and compute the interpolation of the "discovered" pixels. For example, when scrolling down, you may copy the bottom of the previous image and paste it higher, and then compute/draw the new visible stuff at the bottom.
Most modern X11 applications don't use Xlib directly much, if at all. My guess would be that Gimp is rendering the zoomed image into a buffer itself and drawing that to the window, rather than working with the image in an XImage.

Silverlight MediaElement progress

I am trying to create a custom media player in Silverlight. I am working on the Progress Bar. I want the progress bar to display the current Download Progress as well as the Current Position of the MediaElement while it is playing.
To do this I have a Progress Bar to display the download progress and a Slider overlaid to display the current position.
I set the value for both as a percentage out of 100.
For example:
ProgressBar.Value = MediaElement.DownloadProgress;
Slider.Value = (MediaElement.Position.TotalMilliseconds) / (MediaElement.NaturalDuration.TimeSpan.TotalMilliseconds);
The problem is the Slider.Value becomes larger than the ProgressBar.Value. How is this possible? How can I be playing the video at a farther position than what has been downloaded?
Any advice on how to get these to sync up properly?
Thanks.
It's possible because video stream compression algorithms do not result in byte counts proportional to time. Take for example a 300MB video file that runs for say 60 minutes it does not automatically follow that 30 minutes into the file would be that the 150MB point.
If the first part of video is relatively "quiet", it's likely it will compress well whereas busier sections later may not compress so well. As a result it's possible to have downloaded only a small percentage of the file size and yet have played a larger percentage of its overall playing time.
Edit:
So how do I get them to sync up?
You fudge it by limiting the slider to minimum of either the download progress or time.
Slider.Value = Math.Min(mediaelement.Position.TotalMilliseconds / mediaelement.NaturalDuration.TimeSpan.TotalMilliseconds, mediaelement.downloadprogress);

Resources