google-cloud-vision for internal photo repository - google-cloud-vision

Is it possible to use the google-cloud-vision API to match photos with an internal photo directory or sharepoint? The purpose is to find the best match between a specific photo and the existing photos in the repository.

Programmatically speaking, I don't see why not. The API, depending on how you want to use it, has certain requirements. For example, this API post request needs a image in String format. As long as you write a piece of code to pull and convert your image into String format (base64), it works. You can pull the image from the internet or from Google Cloud Storage or your own local machine (as the example mentioned). The API doesn't know nor care about the original location of the image.

Related

Tagging images used for search bar

I'm working with a classmate to build some kind of politicaly-related memes database where users will have the ability to tag images with hashtags, using Meteor. The purpose of this, beyond data collection, is to provide a powerful search engine, where one can find memes with keywords (let's say, for i.e., with the keywords "ukraine" and/or "poutine", you'll find memes related to theses topics) that matches the hashtags.
We have to build everything from scratch, and I'm wondering if someone here have an idea where to start. In other words :
What is the easiest way to host images with Meteor ? Is it through MangoDB ?
Is it possible to change the metadata of the images in the client side ? Do we need to grant this ability using javascript only (or is there also json in it) ?
If we can manage the two first parts, is there a way to link the metadata (the hashtags in that case) with the search engine in order to retrieve the images ?
Thank you for inputs !
It's not easiest but I would store images in Google Cloud Storage or Amazon S3
I would store image metadata in mongodb database. You can update the database from client side by calling Meteor Methods
When users search for images by entering keywords or link with keywords, you can query the database then return the related images.

How do I reference an image from storage in cloud firestore? React

I'm so confused.
I have a form with an input field where you put in a 'title' and an upload file where you upload an 'image'. I created a doc in Cloud Firestore so these are my two fields.
Now, when I upload an image, it gets saved in Storage but I want the image to know to which title it belongs so from what I understand, I need to reference the doc in Cloud Firestore. I don't have any users so I cannot use a uid. I figured that I somehow need the 'access token' from storage, to get saved in the field 'image' in Cloud Firestore. How do I do that?
I'm a beginner so please be as specific as possible!
It's a react app.
You can simply take the string path of the image in Cloud Storage, and store that in the field of a document.
If you have a Reference to a file you just uploaded to Storage, you can use its fullPath property to save it to Firestore and locate it later. You can use the method Storage.ref(fullPath) to rebuild that Reference after you read the string back from the document.
I am having trouble understanding the context of the question, but it seems like there might be some confusion between Real-Time Database, Firestore, and Firebase Storage services (understandable). You may want to use these in concert with one another. I.e. Storage contains your image, but you can create a database meta-data entry for the image, which can link it to a user or menu item or whatever.
Just as you need specific answers, we need specific questions. A statement like, "I want the image to know to which title it belongs," is not accurate to the intended communication purpose. Images don't know anything or have any sense of belonging. I have struggled with this problem a lot myself (in Vue) and I appreciate that it can be difficult to get a straight answer out of the Firebase documentation at present for version 9 web development, but if you follow the guide for accessing data from storage, you should eventually be able to import the "storage" object in React, use the getDownloadURL() function to get an authenticated download url (this is probably the "token" business you are hinting at), and then just treat that image url as if it were any image link.

Firebase: Search in storage using comodin

I'm having a problem trying to search images in my storage instance because I have the following structure:
/cityx/cars/{userId}/{numberPlate}/image_1
/cityx/cars/{userId}/{numberPlate}/image_2
/cityx/cars/{userId}/{numberPlate}/image_3
Each user have it's own folder {userId} and within that folder, has registered many cars indexed by the {numberPlate} and finally inside that {numberPlate} folder exists pictures related to the user so I'm performing a search by the numberPlate but the issue I have is related to.. how to search it having the parent folder with a dynamically name (the userId).
Do you know how to perform a search like that?
Kind regards!
The Firebase Storage API doesn't have the ability to search for images. You must know the full path already to find/load an image.
So if you want to be able to search for specific images, you should store the metadata about the images elsewhere. One common place for structured metadata would be the Firebase Database, such as covered here: How to get an array with all pictures?
If you want more wildcard-like search, you'll want to look into integrating an external search engine, such as Elastic Search.

how to modify stored dcm files

I have the need to mopdify the information of patient,study,series,instance,and I have done this by putting information to dataset that stored in database.Now my question is that the information stored in database does has been modified but the dcm files stored in pacs can't modified.Is there any way to modify the dcm files at the same time?
I could be wrong, but I do not believe dcm4chee changes the images when you edit the fields through the web interface. Instead what it does is it modifies the fields in the data base. When an image is retrieved from the dcm4chee pacs, it will prepare and send the modified images. At that point in time it creates a new image header (updated with changes made through the web UI and the changes required because dcm4chee handled the images). The retriever will then get the modified set of images, dcm4chee will continue to store the original images.
To get the modified images issue a C-STORE request and have dcm4chee send the images to another client or pacs. That system will receive the modified images.
If you have DCM4CHEE 2.17.x, then you should be able to edit some information. Go onto the web interface for your installation and look for the Edit [Patient/Study/Series/Instance] Attributes icon (looks like a document with a pencil). If you click on that, you should be able to enter new values for some of the items.
Most PACS will ignore a storage request if they already have the identical SOP Instance UID value. So, another method to change the data is to use a toolkit to modify the fields you want, and then generate new UID values for the images (and it's a good idea to do the same for the study and series UID values too). This will create duplicate entries, but with different values.

Reading the location from where the image is uploaded

I want to know if this is even possible. One of my requirement is to allow users to upload images, generate new names for those images and rename the images with the new names in the folder from which they were uploaded.
I implemented the first part i.e uploading images based on this blog http://www.raistudies.com/spring/spring-mvc/file-upload-spring-mvc-annotation/
It works fine. But I am unable to find a way to read the location from where these images are uploaded. Usually users will map network drives on their local system and upload these images from those network drives. So I want to if its even possible to read the location.
Any input will be greatly appreciated.
Update: I tried using jquery to read the value in the input filed, but this just give me the image name and not the complete path. eg., C:/Images/OnLoc/abc.img gives me jsut abc.img but I want the complete path i.e C:/Images/OnLoc/abc.img
Thanks,
Lakshmi
It depends. If you are using CommonsMultipartFile, then the getOriginalFilename method might return path data in addition to the filename. As per the API docs:
This may contain path information depending on the browser used, but it typically will not with any other than Opera.
So the short answer is probably not.
You can use JavaScript to store the location in an hidden field when user selects a file to upload and then when user will submit the form, get the value from form bean.

Resources