Log in or register to post comments

Region Capture

March 30, 2016 - 3:33am #187

I have not used the conditions depending on the device. I used Vuforia 5.0.10 and Region Capture 1.7.2 + 1.7.5 update without make some change in frameworks. In my case I take the texture one time when vuforia recognizing the target. To correct the shift I change WaitForTexture method like: 

 

        private IEnumerator WaitForTexture()
	{
		regionCapture.SetActive(true);
		yield return new WaitForEndOfFrame ();
		if(renderCamera.targetTexture)
		{
			regionCapture.GetComponent<Region_Capture>().RecalculateRegionSize();
			regionCapture.GetComponent<RenderTextureCamera> ().RecalculateTextureSize ();
			regionCapture.SetActive (false);
			TextureHelper.setRenderTextureForPrefab(currentPrefab, renderCamera.targetTexture);
		}
		else 
		{
			StartCoroutine(WaitForTexture());
		}
	}

What I have said before! And of course you need set correct all other important settings. 

Region Capture

March 29, 2016 - 8:13am #186

Could you give some details? 

What RegionCapture and Vuforia versions are you using? Did you make some changes in RegionCapture code? If so - what they are? 

Could you post some example code? How do you position RegionCapture prefab on the scene? Is it something like 

if (iPhone() ) { 

   position, scale = ...
} if (iPad() ) {

  position, scale = ... 

} /...

Do you somehow post-process image to remove shift issue? 

Region Capture

March 29, 2016 - 7:30am #185

Hi, Guys!

 

Yes, it's possible. We have the solution where we are using Vuforia + Region Capture frameworks. Of course it's not simply to produce the correct result, however we have made it to all iOS and Android devices. To write a complete documentation or to understand exactly your case, you may have to spend a lot of time and resources, which can't be free.

If you don't mean what can be wrong, try to do it from the beggining, and carefully make any changes you completely incomprehensible.

 

Good luck. 

AttachmentSize
Image icon kopati.jpg66.89 KB

Region Capture

March 29, 2016 - 3:13am #184

Has anyone solved shit issue and could post his solution? I tried Region Capture 1.7.2 , 1.7.5 and some solutions posted here but I always see difference between iPhone and iPad devices. 

Also - why do we have position&scale RegionCapture prefab? If Vuforia knows position of the marker and is able to scale and position objects attached to it in Unity scene aren't we able to read texture out of it using some API? How RegionCapture is exactly working? 

Region Capture

March 18, 2016 - 1:27pm #183

Hi,

anyone has solved the texture shift problem?

thanks..

EG

Region Capture

March 15, 2016 - 3:18pm #182

Guys, do any have working demo project with simple model ? please share it.

Region Capture

March 2, 2016 - 10:12am #181

Hello,

 

I´m getting this bug when building to iOS. On Android I don´t have any trouble.

What could be the cause of this.

I´m using:

Unity 5.3.1f1

iPhone 6

Xcode 7.2

Region Capture 

 

Thanks in advance.

AttachmentSize
Image icon IMG_2406.PNG69.01 KB
Image icon IMG_2404.PNG79.54 KB

Region Capture

February 26, 2016 - 2:02am #180

Thanks, it really helpful and I found that when my phone is portrait it is always have shift but ok when landscape. I use Iphone 6 and the lastest version of region capture. So it may be the code in here 

float aspect = (float)videoTextureInfo.imageSize.x / (float)videoTextureInfo.imageSize.y;
                if (Screen.orientation == ScreenOrientation.Portrait || Screen.orientation == ScreenOrientation.PortraitUpsideDown) {
                    AR_Camera_Vector.transform.localScale = new Vector3 (1.0f / aspectaspect1.0f);
                }

 

Please take a look.

Region Capture

February 25, 2016 - 7:39am #179

To tooMuchMustard / Soznanov

I appreciate your sharing.

According to your suggestion, I put the two lines to GetTexture.cs.

But for my project, the object always comes black as you can see in the picture that I attached below.

I really wonder how you guys get the desired result.

The following is a dropbox link to my unity project.

https://www.dropbox.com/s/5db4447onlvet11/RegionCaptureTest.zip?dl=0

Could you take a look at it and shed some light on me? 

 

 

AttachmentSize
Image icon comesBlack.JPG565.1 KB

Region Capture

February 20, 2016 - 5:20pm #178

Hi Maximrouf, these changes did not fix this for me - however, I found my problem and will describe the fix here if it helps anyone else. For context, I updated Region_Capture.cs to 1.7.5 and added two lines to GetTexture.cs as suggested by soznanov.

I was taking the RenderTexture, and converted it to a 512x512 Texture2D. I used this texture to replace an existing Sprite's texture. The problem was that this Sprite's resolution was 576x576. In the Editor, it apparently was interpreted as 512x512 so in Play mode, the newly created Texture2D matched up just fine. However, on the iPhone 6S+, it did not automagically sync up. Changing the existing Sprite's texture to be natively 512x512 fixed this for me.

Btw, thank you Maximrouf for all your effort and support here. It's a fantastic tool, great work :)

 

 

Region Capture

February 20, 2016 - 1:24pm #177

tooMuchMustard - this problem source is  GameObject AR_Camera_Vector  orintation vector.

 

Try to change this line:

AR_Camera_Vector.transform.localEulerAngles = new Vector3 (0.0f, 180.0f, 180.0f);  // to 0 0 0

Or (And) this lines: 

  if (Screen.orientation == ScreenOrientation.LandscapeLeft) P.m12 *= -1;  // to 1
  if (Screen.orientation == ScreenOrientation.LandscapeRight) P.m02 *= -1; // to 1
 
Run all tests without connected cable.

Region Capture

February 20, 2016 - 10:51am #176

I am running on an iPhone 6S+ and am also experiencing alignment issues, possibly sizing issues too. Running in the Unity Editor on a Macbook Pro using the built-in camera works as intended. Does anyone know what the source of the problem is?

Region Capture

February 20, 2016 - 2:02am #175

However, in Region Capture manual described about use Reculculate method's when the marker has changed. 

Region Capture

February 20, 2016 - 1:59am #174

CodingMon , my method WaitForTexture is not different, I'm needing to use first texture when target is detected. And I use proprietary method for setting texture. 

 

private IEnumerator WaitForTexture()
	{
		regionCapture.SetActive(true);
		yield return new WaitForEndOfFrame ();
		if(renderCamera.targetTexture)
		{
			regionCapture.GetComponent<Region_Capture>().RecalculateRegionSize();
			regionCapture.GetComponent<RenderTextureCamera> ().RecalculateTextureSize ();
			regionCapture.SetActive (false);
			TextureHelper.setRenderTextureForPrefab(currentPrefab, renderCamera.targetTexture);
		}
		else 
		{
			StartCoroutine(WaitForTexture());
		}
	}

 

Region Capture

February 19, 2016 - 10:06am #173

To Maximrouf,

On the contrary, I found that it often works well with iPhone6 while running in the xcode debug mode with a connected cable.

But it keeps failing when running standalone.

 

To soznanov,

According to your finding,  I've tried putting those lines as follows.

--------------------------------------------------------------------------------------------------------------------------------

private IEnumerator WaitForTexture() {

 
yield return new WaitForEndOfFrame ();
 
if (RenderTextureCamera.targetTexture)  {
Region_Capture.GetComponent<Region_Capture>().RecalculateRegionSize();
Region_Capture.GetComponent<RenderTextureCamera> ().RecalculateTextureSize ();
 
 
Debug.Log ("reginCaptureTexture is set");
GetComponent<Renderer> ().material.SetTexture ("_MainTex", RenderTextureCamera.targetTexture);
 
}
 
else StartCoroutine(WaitForTexture());
}

--------------------------------------------------------------------------------------------------------------------------------

But the texutre comes black. 

Could you shed some light on how you put those lines exactly?

 

 

*I'll also try to solve this problem as much as I can and let you know if anything good comes out.

Thank you.

 

Region Capture

February 19, 2016 - 6:08am #172

Hi, friends!

 

I added this strings:  

regionCapture.GetComponent<Region_Capture>().RecalculateRegionSize();
regionCapture.GetComponent<RenderTextureCamera> ().RecalculateTextureSize ();

in WaitForTexture method. And it's solved problem for iPhone 6/6+ and some Android devices where offset was highly visible. But some trouble with shifted texture keep on iPhone 5c. 

 

 

AttachmentSize
Image icon 1.jpg70.41 KB
Image icon 2.jpg73.17 KB
Image icon 3.jpg73.73 KB

Region Capture

February 19, 2016 - 2:34am #171

Hi CodingMon. Could you run the application on IPhone6 without a connected cable?

Sometimes I see this problem with the XCode debug mode.

Region Capture

February 18, 2016 - 12:32pm #170

I really appreciate your efforts, maximrouf.

FYI, the shifted texture problem has gone on iPhone5, but  is still there on iPhone6.

Thank you again.

Region Capture

February 18, 2016 - 4:05am #169
Hello friends.
Sorry for the long time response.
Here are some fixes to help you –
 
 
 

Region Capture

February 17, 2016 - 9:11am #168

Hi, Max. 

I'm trying to catch a texture for coloring 3d models. And meet some trouble with wrong center detection of target. I think this may be due to the definition of the target center vuforia. Becouse if I put little cube in center of coordinate it not always in center of picture. And the offset is often different.

Do you can tell me about what you think and how I can solve it? 

Thanx.

Region Capture

February 17, 2016 - 9:11am #167

Hi, Max. 

I'm trying to catch a texture for coloring 3d models. And meet some trouble with wrong center detection of target. I think this may be due to the definition of the target center vuforia. Becouse if I put little cube in center of coordinate it not always in center of picture. And the offset is often different.

Do you can tell me about what you think and how I can solve it? 

Thanx.

AttachmentSize
Image icon IMG_2016-02-17 20:10:44.jpg114.01 KB

Region Capture

February 14, 2016 - 11:49pm #166

Hi maximrouf,

Gentle Reminder,

The video which you shared was awesome.I tried it with tablet nexus and found problem with skin shifting (working fine on small screen device like moto x, samung duos and so on..).sharing some screenshots with you.please find attachement.

Wating for your help on the same.

Thanks

Vivek Desai

 

Region Capture

February 8, 2016 - 2:29am #165

Hi Vivek,

It would be great if you can help me to capture the color of particular region. I am newbee to Vuforia. 

 

Thanks

Region Capture

February 8, 2016 - 2:29am #164

Hi Vivek,

It would be great if you can help me to capture the color of particular region. I am newbee to Vuforia. 

 

Thanks

Region Capture

February 8, 2016 - 2:29am #163

Hi Vivek,

It would be great if you can help me to capture the color of particular region. I am newbee to Vuforia. 

 

Thanks

Region Capture

February 8, 2016 - 2:29am #162

Hi Vivek,

It would be great if you can help me to capture the color of particular region. I am newbee to Vuforia. 

 

Thanks

Region Capture

February 8, 2016 - 2:29am #161

Hi Vivek,

It would be great if you can help me to capture the color of particular region. I am newbee to Vuforia. 

 

Thanks

Region Capture

February 8, 2016 - 2:29am #160

Hi Vivek,

It would be great if you can help me to capture the color of particular region. I am newbee to Vuforia. 

 

Thanks

Region Capture

February 8, 2016 - 2:29am #159

Hi Vivek,

It would be great if you can help me to capture the color of particular region. I am newbee to Vuforia. 

 

Thanks

Region Capture

February 8, 2016 - 2:29am #158

Hi Vivek,

It would be great if you can help me to capture the color of particular region. I am newbee to Vuforia. 

 

Thanks

Region Capture

February 8, 2016 - 2:29am #157

Hi Vivek,

It would be great if you can help me to capture the color of particular region. I am newbee to Vuforia. 

 

Thanks

Region Capture

February 3, 2016 - 10:08pm #156

Hi maximrouf,

 

The video which you shared was awesome.I tried it with tablet nexus and found problem with skin shifting (working fine on small screen device like moto x, samung duos and so on..).sharing some screenshots with you.please find attachement.

Hope for solution from your side.

 

Thanks

Vivek

Region Capture

February 3, 2016 - 10:05pm #155

Hi maximrouf,

 

Great work!!!

The video which you shared was awesome.I tried it with tablet nexus and found problem with skin shifting (working fine on small screen device like moto x, samung duos and so on..).sharing some screenshots with you.please find attachement.

Hope for solution from your side.

 

Thanks

Vivek

 

 

 

 

Region Capture

February 3, 2016 - 12:30pm #154

hi,

have you solved the shift problem?

thanks

E.

Region Capture

January 28, 2016 - 6:51pm #153

Hi Samuel,  I checked it out... mesh and polygons. I don't see any problems.

All animations works fine. 

Could you pack your demo-project to the zip file and send it to me?

Region Capture

January 28, 2016 - 8:33am #152

Hi Maxim for your excellent work, i have the following problem. when i export the 3D model in Editable POLY  the Region Capture Script Works perfectly, but when i export in Editable Mesh Doesnt work. please the image attached.

 

Thanks so much

 

AttachmentSize
Image icon region capture not work.jpg325.91 KB

Region Capture

January 25, 2016 - 7:21pm #151

Good luck Maxim :)

If it can help, ipad mini 2 and ipad mini 3 have almost identical hardware (camera device is identical, screen size etc...). But the texture is offseted on ipad mini 2. Maybe this two devices can be a good reference to understand what is going wrong on devices with offseted texture. Also, with front camera, it works so far with all the devices we have here (no matter it is ios or android). This also can be a good clue.

Cheers man !
Thibault.

Region Capture

January 21, 2016 - 6:24pm #150
Hello guys. I was not gone.. and everything is fine.
I renew the research of problems with a shift texture.
 
Best regards, Maxim Rouf

Region Capture

January 21, 2016 - 9:28am #149

Hey, how can I make a multi target region capture?
 

I need to do two differents targets appear and get the texture from the relative imageTarget.

Can I do this? If yes, How?

Region Capture

January 21, 2016 - 3:52am #148

@maximrouf Firstly i want to appreciate you effort. Really good work! I used the region capture from December and I was able to make it work flawlessly. Now when I used the Jan update, I am perfomring the same steps, the tecture is being captured in the "Show texture window" but not being applied on my 3d Model. Please let me know if there are some addtional steps to be taken in the new update.

 

Thanks

Region Capture

January 21, 2016 - 12:41am #147

I figured out than using the front camera does not have any offset so far as long as :

1 - Matrix4x4 P = Vuforia.VuforiaUnity.GetProjectionGL (0,0,0) 
has element m00 inversed on android (and m11 inversed on ios devices)

2 - The ratios 

float k_x = (float)videoTextureInfo.imageSize.x / (float)videoTextureInfo.textureSize.x * 0.5f;
float k_y = (float)videoTextureInfo.imageSize.y / (float)videoTextureInfo.textureSize.y * 0.5f;

are recalculated after switching from back camera to front camera.

But I still observe offset on many devices (including both ios devices and android devices).
Did somebody succeed to use the back camera on every devices ?

Region Capture

January 18, 2016 - 2:09pm #146

hi,

any news?

 

thanks..

Region Capture

January 14, 2016 - 1:58pm #145

I have the same shif with samsung galaxy note 4

with the older version, using it in portrait mode is ok.

in landscape mode, the texture is shifted.

with the new version, the shif is present in both mode.

 

AttachmentSize
Image icon shift.jpg127.38 KB

Region Capture

January 7, 2016 - 5:09pm #144

Victor sorry, i can't.  It was 2 hours recording video our team-work without saving project.

Region Capture

January 7, 2016 - 1:55pm #143

I was trying to do some project here, but the model was so unstable, and the color at it wasn't getting right.

Could you provide me that Pumba project?

 

Thanks :D

Region Capture

January 7, 2016 - 2:08am #142

Could you test it out again on mode optimised speed, and see if the offsets still appear, they did go away in ipadmini2, when i tested it

Region Capture

January 7, 2016 - 1:58am #141

I tested region capture 1.7.2 + Vuforia 5.0.10 on many ios devices. I also attached the parameters used for the AR Camera. I would like to know if other people get different results than mine.

The offset appears on : iPad2, iPadAir, iPadMini, iPadMini2, iPadPro, iPhone6.

It does not happen on : iPad3, iPad4, iPadMini3, iPadMini4, iPhone6 S, iPhone6+, iPhone 5S.

I did not test on : iPadAir 2, iPhone 5S, iPhone6+ S, iPhone 4S, iPhone 4.
 

Region Capture

January 6, 2016 - 3:59am #140

Xavier, maybe you're right. I will try to find Ipad mini 2 and do some tests.

It will take me about a week.

Region Capture

January 6, 2016 - 1:46am #139

Hi Maxim,

Using "GL.GetGPUProjectionMatrix" instead of "Vuforia.VuforiaUnity.GetProjectionGL" does not seem to fix the offset on ipad mini 2. Does it mean that the matrix provided by Vuforia is wrong ?

Thanks for your help

Region Capture

January 5, 2016 - 3:59pm #138
Version 1.7.2
 
* "GL.GetGPUProjectionMatrix" changed to "Vuforia.VuforiaUnity.GetProjectionGL"
 

Pages

Log in or register to post comments