Giter Club home page Giter Club logo

imagedataextractor's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

alissa777

imagedataextractor's Issues

The scale bar of some images still fails to detect

Hi, I installed the latest version of imagedataextractor (2.0.4) and run the same codes as example. I found some sample images' scale bar could be detected, but some still failed. I have attached my codes and results below. I am currently learning this program, but I got stuck in the scale bar detection, I hope I can discuss this issue with you. Many thanks.
screenshot.docx

particle size

Hi, I am Alissa.

I manually measured the scale bar of example image. And I got pixel of 68.5. So I input the [ conversion = 200 / 68.5 ] for test.

Then I find that the results are different with the automatic extraction.

I tried the example-image on imageJ and the reults I got via manual conversion by both imagedataextractor and imageJ extraction are similar. But they have great difference with the results shown in example-notebook.

I am confused and I dont know the reason.

Anyway thank you for reading my question.

example Capture2
Screenshot 2021-07-01 at 11 36 21
Screenshot 2021-07-01 at 11 36 40

Chemical Reaction Figure Extraction

Hi,
Thank you for providing the imagedataextractor. I've been trying to use this for image extraction in chemistry-related literature recently. I noticed that example 2 of the online demo version in ChemDataExtractor v2, e.g., I Kinoshita et al., Dalton Trans. (2003), 1993-2003, 10.1039/b210420m was extracted using imagedataextractor, and I was using the imagedataextractor to extract it, and I'm having some difficulties, and I'd like to know exactly how to use it. Can you help with some detailed parameters?

Best wishes,
Xy

error: OpenCV(4.5.5) /io/opencv/modules/dnn/src/layers/convolution_layer.cpp:404: error: (-2:Unspecified error) Number of input channels should be multiple of 3 but got 4 in function 'getMemoryShapes'

Hi there, nice work.
However, please it how can we implement new case image besides the examples given in your Jupyter Notebook?
Cos the last time i TRIED, IT GAVE THIS ERROR:
error: OpenCV(4.5.5) /io/opencv/modules/dnn/src/layers/convolution_layer.cpp:404: error: (-2:Unspecified error) Number of input channels should be multiple of 3 but got 4 in function 'getMemoryShapes'
image

Kindly suggest an appropriate solution. Thank you.

scalebar issuse

Screenshot 2021-04-22 at 10 02 41

Screenshot 2021-04-22 at 09 46 12

Hi My name is Alissa and I have been working on this tool for weeks. I followed the instruction of usage and downloaded the latest version of the tool, but theres still some issues in extraction. As for the test image(first image), I got value error called zero-size array. After I imput another image from the scalebar folder, It showed another error. However I put an image called example, the extraction was success and I got 8 images. Could you please have a look at my issues?

Thank you!

OpenCV error

code issue
Traceback (most recent call last)
in
1 im_path = './example-image.png'
2 device = 'cpu'
----> 3 data = ide.extract(im_path,
4 seg_bayesian=True, # Bayesian mode
5 seg_tu=0.0125, # uncertainty threshold beyond which to filter FPs

D:\hebida\lib\site-packages\imagedataextractor-2.0.4-py3.8.egg\imagedataextractor\extract.py in extract(input_path, seg_bayesian, seg_n_samples, seg_tu, seg_device)
61 images = [image]
62 for i, im in enumerate(images):
---> 63 em_data = _extract_image(im, seg_bayesian, seg_n_samples, seg_tu, seg_device)
64 if len(images) == 1:
65 em_data.fn = fn

D:\hebida\lib\site-packages\imagedataextractor-2.0.4-py3.8.egg\imagedataextractor\extract.py in _extract_image(image, seg_bayesian, seg_n_samples, seg_tu, seg_device)
130 sb_detector = ScalebarDetector()
131 segmenter = ParticleSegmenter(bayesian=seg_bayesian, n_samples=seg_n_samples, tu=seg_tu, device=seg_device)
--> 132 shape_detector = ShapeDetector()
133
134 # initialise EM data object

D:\hebida\lib\site-packages\imagedataextractor-2.0.4-py3.8.egg\imagedataextractor\analysis\shapedetect.py in init(self)
17 self.shapes_dir = os.path.join(os.path.dirname(os.path.abspath(file)), 'shapes/')
18 self.shapes_dict = None # key - name, value - image
---> 19 self.populate_shape_dict()
20
21 def match_shapes(self, mask):

D:\hebida\lib\site-packages\imagedataextractor-2.0.4-py3.8.egg\imagedataextractor\analysis\shapedetect.py in populate_shape_dict(self)
46 for shape_name in self.shape_names:
47 shape_image = cv2.imread(os.path.join(self.shapes_dir, '{}.png'.format(shape_name)))
---> 48 shape_image = cv2.cvtColor(shape_image, cv2.COLOR_BGR2GRAY)
49 shape_images.append(shape_image)
50 self.shapes_dict = dict(zip(self.shape_names, shape_images))

error: OpenCV(4.2.0) C:\projects\opencv-python\opencv\modules\imgproc\src\color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor'

cvDrawContours

Hi,

My name is Alissa.

After I checked the figures and changed them to None. I got an error that happend to most of the images I imput.

But my mate told me that she changed some code to avoid it. I dont know how to get it running successfully without this error.

Thank you for helping me!

Screenshot 2021-04-24 at 09 09 22

Picture 1

list object has no attribute segmentation

I can read the image file

data = ide.extract(image_path)

and get a list of [EMData,EMData...] but any further action

seg = data.segmentation
uncertainty = data.uncertainty

fails as the 'list' object has no attribute 'segmentation'.

BTW as I am mainly interested in segmentation without downstream analysis, isn't there any option for that?

Finetuning IDE scalebar detection

Hi OP,
I've managed to run imagedataextractor successfully and would like to use the contents in the fine tune file in the scalebar section to improve the detection rate of the scalebar. However I have some trouble with running the 'make training' line. I am running ide on windows 10 and the solutions that I have found so far are using Chocolatey to install the 'make' command or using a Linux subsystem, both of which I do not have any experience. Is there a guide on how to use that?
Thank you and I appreciate your help with the previous question I had for ide.

Not reading image files

import imagedataextractor as ide input_path='ide1.jpg' dat = ide.extract(input_path)

`error Traceback (most recent call last)
in
1 input_path='ide1.jpg'
----> 2 dat = ide.extract(input_path)

~/anaconda3/envs/vineeth/lib/python3.6/site-packages/imagedataextractor/extract.py in extract(input_path, seg_bayesian, seg_n_samples, seg_tu, seg_device)
61 images = [image]
62 for i, im in enumerate(images):
---> 63 em_data = _extract_image(im, seg_bayesian, seg_n_samples, seg_tu, seg_device)
64 if len(images) == 1:
65 em_data.fn = fn

~/anaconda3/envs/vineeth/lib/python3.6/site-packages/imagedataextractor/extract.py in _extract_image(image, seg_bayesian, seg_n_samples, seg_tu, seg_device)
139
140 # detect scalebar
--> 141 scalebar = sb_detector.detect(image)
142 em_data.scalebar = scalebar
143 text, units, conversion, scalebar_contour = scalebar.data

~/anaconda3/envs/vineeth/lib/python3.6/site-packages/imagedataextractor/scalebar/scalebar.py in detect(self, image)
108 scalebar = Scalebar()
109
--> 110 rois, roi_locs = self.text_detector.get_text_rois(image)
111 text, best_idx = self.ocr.get_text_from_rois(rois)
112

~/anaconda3/envs/vineeth/lib/python3.6/site-packages/imagedataextractor/scalebar/textdetection.py in get_text_rois(self, image, scale, augment)
96 rois = []
97 roi_locs = []
---> 98 boxes = self.detect_text(image)
99 for x1, y1, x2, y2 in boxes:
100 box_w = int(scale * (x2 - x1))

~/anaconda3/envs/vineeth/lib/python3.6/site-packages/imagedataextractor/scalebar/textdetection.py in detect_text(self, image)
89 blob = cv2.dnn.blobFromImage(image, **blob_params)
90 self.model.setInput(blob)
---> 91 scores, geometry = self.model.forward(self.layer_names)
92 boxes = self.postprocess_detections(scores, geometry)
93 return boxes

error: OpenCV(4.5.3) /tmp/pip-req-build-tjxnaiom/opencv/modules/dnn/src/layers/convolution_layer.cpp:385: error: (-2:Unspecified error) Number of input channels should be multiple of 3 but got 1 in function 'getMemoryShapes'`

manully measure scalebar

Hi, I am Alissa.

I got issue about scalebar detection. As the image shown, the scalebar is 50 nm, but the output particle size are over 400 nm. I think its not right. The particle size should be less than 50 nm. Then I imput the Example image and got same error.

Screenshot 2021-05-08 at 10 41 49

Screenshot 2021-05-08 at 10 28 29

Last time you replied me that if I have to measure scalebar manually to get the result in this case. Could you please instruct me to measure it by myself?

Screenshot 2021-05-08 at 10 32 53

Screenshot 2021-05-08 at 10 26 01

Thank you for reading my writing.

xml read error

Trying to read a local xml file on drive:

import imagedataextractor as ide
input_path='test.xml'
dat = ide.extract(input_path)

It gives the error:

----> 2 dat = ide.extract(input_path)

~/anaconda3/envs/vineeth/lib/python3.6/site-packages/imagedataextractor/extract.py in extract(input_path, seg_bayesian, seg_n_samples, seg_tu, seg_device)
    100         error_msg = 'Input is invalid. Provide a path to an image, a path to a document of type {}, or a path to a directory of images and/or documents.'.format(allowed_doc_exts[:2])
    101         raise TypeError(error_msg)
--> 102     if len(data) == 1:
    103         data = data[0]
    104     return data

UnboundLocalError: local variable 'data' referenced before assignment

Scalebar conversion

Hi

My name is Alissa. Sorry for bother you. It's me agian. I use ImageJ to measure the scalebar in pixel.

As the image 1 shown, this 20nm scalebar was converted to distance in pixels of 83.5. I think its right. However, I dont know how to input this figure into the code to make the tool process smoothly.

Could I input this 83.5 manually into the original code?

Thank you!

Capture2

Screenshot 2021-05-25 at 14 47 08

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.