cdut007 / javacv

Automatically exported from code.google.com/p/javacv
GNU General Public License v2.0
0 stars 0 forks source link

FlyCaptureConvertImage() Error 1 #91

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
just after "start calibration" of procamcalib

What is the expected output? What do you see instead?
error info instead of running calibration

What version of the product are you using? On what operating system?
windows 7 32 bit

Please provide any additional information below.
Pls refer to the attachment.

Thanks!
- Feng

Original issue reported on code.google.com by fengzhen...@gmail.com on 25 Jul 2011 at 9:09

Attachments:

GoogleCodeExporter commented 9 years ago
and the camera is Point Grey Flea-HICOL

Original comment by fengzhen...@gmail.com on 26 Jul 2011 at 1:10

GoogleCodeExporter commented 9 years ago
Yes, the newer versions of FlyCapture have less capabilities to convert between 
image formats for some reason. Before starting the calibration, please try to 
set your camera to a BGR (or maybe they call it RGB) image format.

Original comment by samuel.a...@gmail.com on 26 Jul 2011 at 4:17

GoogleCodeExporter commented 9 years ago
Thank you! It's solved by installing an older version of flycap, i.e. flycap 
v1.8 instead of the latest version v2.2.

But the calibration failed several trials. It seemed that the printed markers 
well not well recognized, perhaps for the reason that the marker board is 
printed on a A4 size paper.

And in the attachment photos, the camera properties were not displayed while 
the projector properties did. Is this a problem, e.g. indicating the camera is 
not working well?

Thanks,
- Feng

Original comment by fengzhen...@gmail.com on 26 Jul 2011 at 8:57

Attachments:

GoogleCodeExporter commented 9 years ago
Actually, the projector properties showed in the software interface is also a 
little wrong. The actual projector resolution is 1280x800 while the software 
shows it's 1680x1050.

Original comment by fengzhen...@gmail.com on 26 Jul 2011 at 9:00

GoogleCodeExporter commented 9 years ago
If you see images from your camera, then it is working. The properties do now 
show up simply because they are unknown until we start the capture. Please read 
the README.txt file for the answers to your questions.

Original comment by samuel.a...@gmail.com on 27 Jul 2011 at 4:21

GoogleCodeExporter commented 9 years ago
Hum, I did not seem to provide this hint in the README.txt file, but you should 
make sure that the "screenNumber" corresponds to the one of your projector.

Original comment by samuel.a...@gmail.com on 27 Jul 2011 at 4:24

GoogleCodeExporter commented 9 years ago
Yes, I figured that out, i.e. making projector number the same as display 
number. I have two displays (1 projector and 1 monitor). If the two displays 
are in extended mode, the projector properties panel always shows Display1 and 
Projector 0, no matter what the order of the displays and which one is main 
screen. So I had to first duplicate the two screen and then run the 
projCamCalib software so that the software "thought" the monitor is no.0 
corresponding to Projector 0, then I can switch it back to extended mode.

However, the calibration failed. The printed markers were well recognized I 
think. Can you help me to solve this problem?

Regards,
- Feng

Original comment by fengzhen...@gmail.com on 27 Jul 2011 at 3:23

Attachments:

GoogleCodeExporter commented 9 years ago
Or you could simply insert 0 as the `screenNumber` in the properties of 
ProCamCalib.

If you don't see IDs in green overlapped on the markers, then no, they are not 
detected or recognized. You need to make them appear better

Original comment by samuel.a...@gmail.com on 28 Jul 2011 at 3:34

GoogleCodeExporter commented 9 years ago
Thank you very much! I calibrated the projector-camera pair successfully. It's 
indeed a very user-friendly method. 

I also tested your procam tracker, but it failed at "initial alignment" (after 
manual clicking ROI).

The debug info is as below, and also software screenshot and image taken by my 
iphone, and pro-cam calibration result in a txt file. Can you tell me what's 
wrong?

initial a = (0.042905662, 0.0947633, 0.20926677)
initializing plane parameters...
iteratingTime = 4125  iterations = 100  objectiveRMSE = 0.13868997
initial n = [ -7.130637E-4
              4.0742456E-5
              -2.993023E-4 ]

iteratingTime  iterations  objectiveRMSE
----------------------------------------

Statistics
==========
pyramidLevel  averageTime  averageIterations
--------------------------------------------
0  0±0  NaN±NaN
1  0±0  NaN±NaN
2  0±0  NaN±NaN
3  0±0  NaN±NaN
4  0±0  NaN±NaN
total  NaN±NaN  NaN±NaN

Total average time: Infinity ms
initial a = (0.04281444, 0.09473165, 0.21224657)
initializing plane parameters...
iteratingTime = 4891  iterations = 76  objectiveRMSE = 0.15419105
initial n = [ -6.390623E-4
              8.8140725E-5
              -2.9589215E-4 ]

iteratingTime  iterations  objectiveRMSE
----------------------------------------

Statistics
==========
pyramidLevel  averageTime  averageIterations
--------------------------------------------
0  0±0  NaN±NaN
1  0±0  NaN±NaN
2  0±0  NaN±NaN
3  0±0  NaN±NaN
4  0±0  NaN±NaN
total  NaN±NaN  NaN±NaN

Total average time: NaN ms

Thanks,
- Feng

Original comment by fengzhen...@gmail.com on 2 Aug 2011 at 7:27

Attachments:

GoogleCodeExporter commented 9 years ago
It may be possible that your hardware latency is greater than the amount 
specified in the Projector/latency setting or maybe 
TrackingWorker/lostObjectThreshold is too low, so you should try to increase 
those... But this is going to be very hard to debug remotely...

Original comment by samuel.a...@gmail.com on 6 Aug 2011 at 10:35

GoogleCodeExporter commented 9 years ago
I tried to modify them, but still didn't work. 

Is it wrong to have surface normal value like below? If the surface is facing 
roughly to projector-camera (they aligned roughly together), the value should 
be like (0,0,1), right?
initial n = [ -6.390623E-4
              8.8140725E-5
              -2.9589215E-4 ]

Thanks,
- Feng

Original comment by fengzhen...@gmail.com on 9 Aug 2011 at 8:19

GoogleCodeExporter commented 9 years ago
Yes the third value should be at least an order of magnitude larger than the 
other two. Your calibration is probably not accurate enough.

Original comment by samuel.a...@gmail.com on 11 Aug 2011 at 12:26

GoogleCodeExporter commented 9 years ago
I calibrated several times with different parameters, but it still didn't work. 
How do you determine with procam_calib whether an calibration is accurate or 
not?

Thanks,
- Feng

Original comment by fengzhen...@gmail.com on 18 Aug 2011 at 6:58

GoogleCodeExporter commented 9 years ago
You check the calibration error. Please do read the README.txt files.

Original comment by samuel.a...@gmail.com on 20 Aug 2011 at 11:48

GoogleCodeExporter commented 9 years ago
Thanks! I have read the Readme file several times. 

Camera: reprojection RMS/max error (pixels) = 0.37726054 / 1.0214705
Projector: reprojection RMS/max error (pixels) = 0.33236763 / 1.3301842

I think this can tell the calibration is good enough. 

The ProCamTracker still didn't work, always failed at initial alignment stage, 
i.e. computing surface normal. It failed to converge, don't know why. I'm 
currently debug the code to see if I can find a clue.

Original comment by fengzhen...@gmail.com on 22 Aug 2011 at 2:19

GoogleCodeExporter commented 9 years ago
And what about the color calibration?

Original comment by samuel.a...@gmail.com on 27 Aug 2011 at 7:57

GoogleCodeExporter commented 9 years ago
Camera:
Color
-----
order = BGR
mixing matrix = [ 1.0, 0.0, 0.0
                  0.0, 1.0, 0.0
                  0.0, 0.0, 1.0 ]
additive light = [ 0.0
                   0.0
                   0.0 ]
normalized RMSE (intensity) = 0.0
R2 (intensity) = 1.0

Projector
Color
-----
order = BGR
mixing matrix = [ 0.71522653, 0.20658377, -0.03718247
                  0.15654738, 0.55716276, 0.05931513
                  -0.0066957376, 0.11858243, 0.4688078 ]
additive light = [ 0.047769856
                   0.15184394
                   0.24215257 ]
normalized RMSE (intensity) = 0.07168312
R2 (intensity) = 0.91113156

=====================
For full info of the calibration, pls refer to the attachment.
I also attached the settings of the camera. I think they may be useful for you 
to debug.

I really appreciate your help.

Thanks,
- Feng

Original comment by fengzhen...@gmail.com on 28 Aug 2011 at 10:04

Attachments:

GoogleCodeExporter commented 9 years ago
The error of your color calibration is very bad. Make sure the gammas of your 
camera and projector correspond to the one you specify in the settings. It is 
usually 1.0 or 2.2, but sometimes that does not work either... Please ask the 
manufacturers of your camera and projector

Original comment by samuel.a...@gmail.com on 29 Aug 2011 at 1:55

GoogleCodeExporter commented 9 years ago
Thanks! But I cannot see that the color calibration is very bad from the 
result. How did you tell that? From R2 (what does it mean?)?

I calibrated the system again, and it got following result, seems a little 
better but not that different from previous one. I set the gamma of camera to 
be 2.2. And projector gamma is 2.2. 

FYI, the camera is Flea-Hicol. The image format is Y8 (cannot choose RGB), and 
frame rate is 15Hz.

Camera Color
-----
order = BGR
mixing matrix = [ 1.0, 0.0, 0.0
                  0.0, 1.0, 0.0
                  0.0, 0.0, 1.0 ]
additive light = [ 0.0
                   0.0
                   0.0 ]
normalized RMSE (intensity) = 0.0
R2 (intensity) = 1.0

Projector Color
-----
order = BGR
mixing matrix = [ 0.55729264, 0.20814215, -0.032831885
                  0.060074292, 0.4660986, 0.042507507
                  -0.055179894, 0.08932595, 0.37596452 ]
additive light = [ 0.2160994
                   0.3772638
                   0.48081127 ]
normalized RMSE (intensity) = 0.063906536
R2 (intensity) = 0.8974704

Original comment by fengzhen...@gmail.com on 29 Aug 2011 at 9:29

GoogleCodeExporter commented 9 years ago
In addition, when the software was doing color calibration, it cannot continue 
when projecting some color (see attachment), and I had to keeping changing the 
pose of the marker board till it recognized the marker board.

Original comment by fengzhen...@gmail.com on 29 Aug 2011 at 11:34

Attachments:

GoogleCodeExporter commented 9 years ago
"normalized RMSE" should be around 0.001 or less, and R2 around 0.999 or more

R2: http://en.wikipedia.org/wiki/Coefficient_of_determination

(I guess I should change that to R^2...)

And no you should not move the board around. Please make the markers clearer as 
indicated in the README.txt file, such as using more than 8 bpp, which should 
help..

Original comment by samuel.a...@gmail.com on 30 Aug 2011 at 12:57

GoogleCodeExporter commented 9 years ago
OK. Thanks!

I tried to use more than 8bpp, i.e. Y16 or Raw16, but it always reports a 
severe error, as shown in the attachment (flycaptureCovnertImage() Error 2).

Original comment by fengzhen...@gmail.com on 30 Aug 2011 at 4:46

Attachments:

GoogleCodeExporter commented 9 years ago
That should work, but I guess there may very well be a bug in there (and 
FlyCapture isn't helping .. libdc1394 works better, but not on Windows 
unfortunately)

Original comment by samuel.a...@gmail.com on 1 Sep 2011 at 11:45

GoogleCodeExporter commented 9 years ago
Fixed that flycaptureConvertImage() error in the latest release

Original comment by samuel.a...@gmail.com on 1 Oct 2011 at 1:44

GoogleCodeExporter commented 9 years ago
But it still reported error when I tried the latest version with camera image 
format as Y16...
The error message is a little different from previous one. It's now 
FlyCaptureFrameGrabber.java:405 not 401.

Thank you very much for keeping updating JavaCV!

Original comment by fengzhen...@gmail.com on 4 Oct 2011 at 7:38

Attachments:

GoogleCodeExporter commented 9 years ago
Well, it works just fine for me here. Make sure your image is not actually a 
Bayer image, but a real grayscale, monochrome image, because newer versions of 
FlyCapture do not support conversion from Bayer or YUV to RGB anymore, for some 
reason...

In any case, if you figure out what does not work on your system, let me know 
and I will fix it, thank you

Original comment by samuel.a...@gmail.com on 6 Oct 2011 at 12:21