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

Adding Nft and 2d tracking. #7

Open
kalwalt opened this issue Aug 16, 2019 · 10 comments
Open

Adding Nft and 2d tracking. #7

kalwalt opened this issue Aug 16, 2019 · 10 comments
Labels
code design All about coding design enhancement New feature or request Medium priority medium priority issue

Comments

@kalwalt
Copy link
Collaborator

kalwalt commented Aug 16, 2019

This a feature that absolutely we need to add. We will collect here all the issues and solutions for implementing this feature.

@kalwalt kalwalt added enhancement New feature or request code design All about coding design Medium priority medium priority issue labels Aug 16, 2019
@ThorstenBux
Copy link

ThorstenBux commented Aug 16, 2019 via email

@kalwalt
Copy link
Collaborator Author

kalwalt commented Aug 18, 2019

Probably we don't need nft but for 2d tracking I need to solve the OpenCv issue with Cmake #8 In the meantime i tried to compile ArtoolkitX.js with NFt enabled: it is required to modify the CMakeLists.txt
https://github.com/augmentmy-world/artoolkitx/blob/4b707183779b7ff0cf9434620eb4f2f284f11219/Source/CMakeLists.txt#L173
change to

- set(HAVE_NFT 0)
+ set(HAVE_NFT 1)

in the KPM directory make this change in the CMakeLists.txt add at the top this:

if(NOT ARX_TARGET_PLATFORM_WINDOWS)
	  if(NOT ARX_TARGET_PLATFORM_EMSCRIPTEN)
			find_package(JPEG REQUIRED)
		endif()
else()
	find_path(JPEG_INCLUDE_DIR
		NAMES jconfig.h jmorecfg.h jpeglib.h jversion.h
		PATHS ${PROJECT_SOURCE_DIR}/depends/windows/include
		DOC "The directory where jpeg headers resides"
	)

	find_library(JPEG_LIBRARIES
		NAMES libjpeg
		PATHS ${PROJECT_SOURCE_DIR}/depends/windows/lib/x64
		DOC "The directory where jpeg static library resides"
	)
endif()

and at the end add the libAR2 and libKPM to https://github.com/augmentmy-world/artoolkitx/blob/4b707183779b7ff0cf9434620eb4f2f284f11219/Source/artoolkitx.js/CMakeLists.txt#L17

- link_libraries(libARX libARVideo libAR libARG libARUtil)
+ link_libraries(libARX libARVideo libAR libAR2 libARG libARUtil libKPM)

testing example in my branch https://github.com/kalwalt/artoolkitX.js/tree/NFT-feature with simple_video_nft.html example.
The nft dataset start to load but fails while try to load the other files see the log:

Live reload enabled.
artoolkitx.js:6 [info] artoolkitX v1.0.2 initalised.
artoolkitX.api.js:66 Version: 1.0.2
artoolkitx.js:6 [info] Starting...
artoolkitx.js:6 [info] Setting video configuration '-module=Web -width=640 -height=480'.
artoolkitx.js:6 [info] Setting camera parameters file '/camera_param_0'.
artoolkitx.js:6 [info] Opening artoolkitX video using configuration '-module=Web -width=640 -height=480'.
artoolkitx.js:6 [info] Using supplied video config "-module=Web -width=640 -height=480".
artoolkitx.js:6 [info] ar2VideoOpenAsyncWeb '-module=Web -width=640 -height=480'.
artoolkitX.api.js:84 artoolkitX started
artoolkitx.js:6 [info] ARVideoSource::webVideoPushInit ... 
artoolkitx.js:6 [info] Opened artoolkitX video 640x480@4Bpp (AR_PIXEL_FORMAT_RGBA).
artoolkitx.js:6 [info] Camera parameters loaded from file '/camera_param_0'.
simple_video_nft.html:40 start done
artoolkitX.api.js:288 we are in NFT
artoolkitX.api.js:291 /trackable_0
artoolkitx.js:6 [info] Loading '/trackable_0.fset'.
artoolkitx.js:6 [info] 
artoolkitx.js:6 ### Surface No.1 ###
artoolkitx.js:6 [info]   Read ImageSet.
artoolkitx.js:6 [error] Error: unable to open file '/trackable_0.iset' for reading.
artoolkitx.js:6 [error] Error opening file '/trackable_0.iset'.
artoolkitx.js:6 [error] Error reading data from '/trackable_0.fset'.
artoolkitx.js:6 [error] Error: Failed to load trackable.
artoolkitX.api.js:312 Uncaught (in promise) Faild to add Trackable: -1
simple_video_nft.html:42 [Violation] 'setInterval' handler took 717ms
simple_video_nft.html:42 [Violation] 'setInterval' handler took 165ms
simple_video_nft.html:42 [Violation] 'setInterval' handler took 55ms

Probably a similar ajax issue with multi marker? see #3

I think i will try again to setup 2d tracking, i need to solve the OpenCV with Cmake. Maybe forcing cmake to find the libs and includes.

@kalwalt
Copy link
Collaborator Author

kalwalt commented Aug 18, 2019

@ThorstenBux you should also update your https://github.com/augmentmy-world/artoolkitx emscripten branch to the latest

@SystemDiagnosticss
Copy link

Any progress in this brunch?

@ThorstenBux
Copy link

We welcome contributions. What are you looking for?

@kalwalt
Copy link
Collaborator Author

kalwalt commented Oct 10, 2019

@SystemDiagnosticss the main issue is to load the nft data see some my attempts (not woking yet) in this PR #18 . Unfortunately I hadn't the time to work on this again...

@SystemDiagnosticss
Copy link

SystemDiagnosticss commented Oct 11, 2019

@ThorstenBux Thank's for reply. I need 2dtracking or nft detection multiple img!

I can't run 2d tracking example because I have error:
Uncaught (in promise) Error: Faild to add Trackable: undefined at ARController.addTrackable (artoolkitX.api.js:411) at simple_2d_tracking.html:163

It's because in your example trackableType: "2d" :
var trackable = { trackableType: "2d", url: './Data/Alterra_Postcard_2.jpg', width: 1.0 }

but in your library function async addTrackable has only two type single and multi and don't have 2d.

Any idea?

@SystemDiagnosticss
Copy link

@kalwalt What reason to delete 2dtracking from lib in your commit ? :)

@SystemDiagnosticss
Copy link

@ThorstenBux @kalwalt what exactly difference between 2d tracking and NFT?? If I understand right in 2d tracking case we use jpg and in NFT case we use fset, fset3, iset ?? That's all??

@kalwalt
Copy link
Collaborator Author

kalwalt commented Oct 11, 2019

@SystemDiagnosticss 2d tracking is not working at the moment so i cleaned the code. The main difference between the two is that with 2d tracking you can use a simple image as detector ( a .jpg for example) and the code is based on OpenCV, instead with NFT you need the precompiled set as you pointed out, and the code is plain ArtoolKitX.
Multi marker is not working with the latest commit release. I think it is an issue related to Promise and async, i had tryed to fix but i hadn't too much time to continue. I have to admit i don't feel very confortable with these kind of issues... 😢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code design All about coding design enhancement New feature or request Medium priority medium priority issue
Projects
None yet
Development

No branches or pull requests

3 participants