Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hi there #1

Open
udiNur opened this issue Jun 24, 2018 · 5 comments
Open

hi there #1

udiNur opened this issue Jun 24, 2018 · 5 comments

Comments

@udiNur
Copy link

udiNur commented Jun 24, 2018

hi there,
hi working on a little project for myself, that I'm using on ueye camera.
I work in python, and when I search on GitHub for a framework that does a better job from the pyeue lib I found your repo.

As you probably know, there are many things that you can add to your lib.
I need a few specific things that I can pay (via PayPal or something) for them, and you can add them to your repo also.

I will be happy that you contact me at [email protected], and send me there skype/WhatsApp or hangout, and your time zone, for we can talk about it.

if you can, also write here a comment, that for I don't miss your email.

thanks

@galaunay
Copy link
Owner

Hi,

Thank you for your interest.

Unfortunately, I stopped trying to use pyueye because I had some trouble implementing some features I needed. I am not really willing to give it another try at the moment.

Maybe if you could develop a bit what you need I could give you some leads on how to do it on a fork of pypyueye.

@udiNur
Copy link
Author

udiNur commented Jun 24, 2018

hi

first, thank you for your response!

you doing here amazing and required job! the code is so simple and writing so good.
from your code, I lorn a lot on how to work with pyeye in the right way.

I need a few things:

  1. master gain automatic - enable/disable
  2. expose automatic - enable/disable
  3. the color of the camera is not normal, if you don't know what I mean, I can add a picture.
  4. record video: your function working in very low fps, I need it in the fps that I use in the app-view
    A. I need to show the video live in the app, and also add an option to start and stop recording (without losing quality in the video file or in the live-view.

I successfully manage to change the fps (of the app view, but not in video recording ) using your function and also change the expose of the cam (you have a bug in your function:

def set_exposure(self, exposure):
        """
        Set the exposure.
        Returns
        =======
        exposure: number
            Real exposure, can be slightly different than the asked one.
        """
        new_exposure = ueye.c_double()
        check(ueye.is_Exposure(self.h_cam,
                               ueye.IS_EXPOSURE_CMD_SET_EXPOSURE,
                               new_exposure, 8))
        return new_exposure

here you not setting the new exposure, insted you give empty c_double var,
i change the new_exposure = ueye.c_double() to new_exposure = ueye.c_double(exposure) and then its work perfectly)

I also successfully manage to change the gain.

If I solve things for good, I'll be happy to make a pull request.

@galaunay
Copy link
Owner

Thanks for finding the bug.
I will gladly accept a PR.

  • I don't think auto exposure and auto gain are available in pyueye (or at least I couldn't find the functionality). But you should be able to do it from within python, by adjusting the exposure and the gain in function of the histogram of the image you get. I think it should not be too difficult to add the necessary set_gain method by using set_exposure as a template.
  • I always used my cameras in grey-scale, so a bug on the image colour may have been unnoticed. If you have an image to send me (and the code you used to get it) I may be able to see what's wrong.
  • Regarding recording videos, it may be slower than expected because it's encoding the video during the acquisition. The function basically wait for the image to be encoded (which can be relatively long) before gathering the next image, resulting in low fps. The good way of doing that would be to modify the RecordThread to just store the images in memory, an encoding all the images at the end of the acquisition.
  • Anyway, if you want both the live view and recording the video, you will need to write your own thread function (combining FrameThread and RecordThread).

I don't have access to any ueye camera at the moment,
hope this still helps.

@udiNur
Copy link
Author

udiNur commented Jun 28, 2018

hi,
about the gain:

I also successfully manage to change the gain.
I used your code to solve it :)

  • and update from now, I happy to say that I succeeded to set the gain to auto mode!
    using this code:
    # TODO find out what das the sec value
    def set_expose_auto(self, value, value_to_return=0):
        """
        Set auto expose to on/off.

        Args
        =======
        value: int Number;
        value_to_return: int Number
        Returns
        =======
        list: report
        """

        print("set auto gain to {}, (additional sets to: {})".format(value, value_to_return))
        value = ueye.c_double(float(value))
        value_to_return = ueye.c_double(float(value_to_return))
        print("cTypes: arg1: '{}' arg2: '{}'".format(value.value, value_to_return.value))
        report = [ueye.is_SetAutoParameter(self.h_cam,
                                           ueye.IS_AUTO_EXPOSURE_RUNNING,
                                           value,
                                           value_to_return
                                           ), value.value, value_to_return.value]
        print(report)
        return report
  • the bug that I found, idk if it that a real bug, because I'm not a camera expert, and this is the result
    about the automatic exposer I still not found who to do it, do you have any idea?

here is the image that I grab from the program:
cam_proggram

here is the image that I grab using the pyueye & pypyeueye examples
me

like you can see, the pillow on the bad is in a blue color in the first image (the snapshot the official ids program), this is the color of the pillow.
in the second image, as you can see, the color is orange (all of the colors in the image are not like in the first image). do you know why? and who can I solve it?

thank you very much for all the help! and sorry about my English

@galaunay
Copy link
Owner

galaunay commented Jul 3, 2018

and update from now, I happy to say that I succeeded to set the gain to auto mode!

That is great, I didn't know about the SetAutoParameter function.

about the automatic exposer I still not found who to do it, do you have any idea?

After a quick search, they seems to refer exposure time as 'shutter' time. So you may be able to get auto exposure using the same kind of code as for auto gain, but with IS_SET_ENABLE_AUTO_SHUTTER.

like you can see, the pillow on the bad is in a blue color in the first image (the snapshot the official ids program), this is the color of the pillow.
in the second image, as you can see, the color is orange (all of the colors in the image are not like in the first image). do you know why? and who can I solve it?

Thanks for providing the images. As the colors are not completely incoherent (like reversed levels or colours swapped, my first guess would be color correction from the camera or the software. There is something in the API documentation here about color correction on the camera side:

The Correction class provides methods for setting the color correction for color cameras. This enhances the rendering of colors for cameras with color sensors. Color correction is a digital correction based on a color matrix which is adjusted individually for each sensor.

It should be accessible through is_SetColorCorrection.

Are you getting closer to what you wanted ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants