Skip to content

Commit

Permalink
working on split screen processing option
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronwmorris committed Oct 3, 2023
1 parent e770cc9 commit b73f626
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 7 deletions.
1 change: 1 addition & 0 deletions indi_allsky/flask/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -3422,4 +3422,5 @@ class IndiAllskyImageProcessingForm(FlaskForm):
IMAGE_ALIGN_POINTS = IntegerField('Alignment points', validators=[DataRequired(), IMAGE_ALIGN_POINTS_validator])
IMAGE_ALIGN_SOURCEMINAREA = IntegerField('Minimum point area', validators=[DataRequired(), IMAGE_ALIGN_SOURCEMINAREA_validator])
#IMAGE_STACK_SPLIT = BooleanField('Stack split screen')
PROCESSING_SPLIT_SCREEN = BooleanField('Split screen')

18 changes: 18 additions & 0 deletions indi_allsky/flask/templates/imageprocessing.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,23 @@

<hr>

<!--
<div class="form-group row">
<div class="col-sm-2">
{{ form_image_processing.PROCESSING_SPLIT_SCREEN.label }}
</div>
<div class="col-sm-2">
<div class="form-switch">
{{ form_image_processing.PROCESSING_SPLIT_SCREEN(class='form-check-input') }}
<div id="PROCESSING_SPLIT_SCREEN-error" class="invalid-feedback text-danger" style="display: none;"></div>
</div>
</div>
<div class="col-sm-8"></div>
</div>
<hr>
-->

<div class="form-group row">
<div class="col-sm-2">
{{ form_image_processing.DETECT_MASK.label(class='col-form-label') }}
Expand Down Expand Up @@ -596,6 +613,7 @@ <h5>These options are applied to the unprocessed image automatically</h5>
'IMAGE_STRETCH__MODE1_ENABLE',
'AUTO_WB',
'IMAGE_STACK_ALIGN',
//'PROCESSING_SPLIT_SCREEN',
];

var fields = {};
Expand Down
2 changes: 2 additions & 0 deletions indi_allsky/flask/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3554,6 +3554,7 @@ def get_context(self):
'IMAGE_ALIGN_DETECTSIGMA' : self.indi_allsky_config.get('IMAGE_ALIGN_DETECTSIGMA', 5),
'IMAGE_ALIGN_POINTS' : self.indi_allsky_config.get('IMAGE_ALIGN_POINTS', 50),
'IMAGE_ALIGN_SOURCEMINAREA' : self.indi_allsky_config.get('IMAGE_ALIGN_SOURCEMINAREA', 10),
'PROCESSING_SPLIT_SCREEN' : False,
}

# SQM_ROI
Expand Down Expand Up @@ -3658,6 +3659,7 @@ def dispatch_request(self):
p_config['IMAGE_ALIGN_POINTS'] = int(request.json['IMAGE_ALIGN_POINTS'])
p_config['IMAGE_ALIGN_SOURCEMINAREA'] = int(request.json['IMAGE_ALIGN_SOURCEMINAREA'])
p_config['IMAGE_STACK_SPLIT'] = False
p_config['PROCESSING_SPLIT_SCREEN'] = bool(request.json.get('PROCESSING_SPLIT_SCREEN', False))


# SQM_ROI
Expand Down
10 changes: 5 additions & 5 deletions indi_allsky/processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ def stack(self):


if self.config.get('IMAGE_STACK_SPLIT'):
self.image = self._splitscreen(i_ref['hdulist'][0].data, self.image)
self.image = self.splitscreen(i_ref['hdulist'][0].data, self.image)


stack_elapsed_s = time.time() - stack_start
Expand Down Expand Up @@ -1466,14 +1466,14 @@ def scale_image(self):
self.image = cv2.resize(self.image, (new_width, new_height), interpolation=cv2.INTER_AREA)


def _splitscreen(self, original_data, stacked_data):
def splitscreen(self, original_data, new_data):
# if flip horizontal is set, this data will swap sides later
if self.config.get('IMAGE_FLIP_H'):
left_data = stacked_data
left_data = new_data
right_data = original_data
else:
left_data = original_data
right_data = stacked_data
right_data = new_data


image_height, image_width = left_data.shape[:2]
Expand Down Expand Up @@ -2362,7 +2362,7 @@ def stretch(self):


if is_stretched and self.config.get('IMAGE_STRETCH', {}).get('SPLIT'):
self.image = self._splitscreen(self.image, stretched_image)
self.image = self.splitscreen(self.image, stretched_image)
return


Expand Down
4 changes: 2 additions & 2 deletions testing/align_rolling.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def main(self, inputfiles):


if self.split_screen:
stacked_img = self._splitscreen(reference_hdulist[0].data, stacked_img)
stacked_img = self.splitscreen(reference_hdulist[0].data, stacked_img)


stacked_bitdepth = self._detectBitDepth(stacked_img)
Expand Down Expand Up @@ -260,7 +260,7 @@ def _crop(self, image):
]


def _splitscreen(self, left_data, right_data):
def splitscreen(self, left_data, right_data):
image_height, image_width = left_data.shape[:2]


Expand Down

0 comments on commit b73f626

Please sign in to comment.